This isn't really a bug report, but I wasn't sure where else to ask the following question. Hugs used to handle all of my SOE code with no problem. Now, however, I get the error message: ERROR "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":2 - Syntax error in module definition (unexpected keyword "with "; possible cause: -W option not used.) Indeed, when I invoke Hugs -W from a command line, everything works fine. So the problem is apparently because Hugs used to allow this language extension as a default, and now doesn't. I would hate to tell everyone using SOE that they have to invoke Hugs from a command prompt, so I'm looking for an alternative suggestion if you have any. Of course, I could rewrite the code, but it's actually Alastair's code, and I'm not sure how big of an effort it is... Thanks, -Paul
On Wed, Sep 17, 2003 at 04:03:07PM -0400, Paul Hudak wrote:
This isn't really a bug report, but I wasn't sure where else to ask the following question. Hugs used to handle all of my SOE code with no problem. Now, however, I get the error message:
ERROR "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":2 - Syntax error in module definition (unexpected keyword "with "; possible cause: -W option not used.)
Indeed, when I invoke Hugs -W from a command line, everything works fine. So the problem is apparently because Hugs used to allow this language extension as a default, and now doesn't.
I think the problem is that Hugs (up to and including Nov2002) had +W set (to support the obsolete syntax for implicit parameters) if you set -98. But now because that syntax is obsolete, MarshalUtils uses "with" as an identifier.
I would hate to tell everyone using SOE that they have to invoke Hugs from a command prompt, so I'm looking for an alternative suggestion if you have any. Of course, I could rewrite the code, but it's actually Alastair's code, and I'm not sure how big of an effort it is...
The two sides of the problem (+W and MarshalUtils) are both in Hugs, I think. But what puzzles me is how hugs got the -98 option. Maybe you can pass -W the same way.
Hi Paul, On Windows, at least, Hugs used to cache command line options in the registry so that they would persist from one Hugs session to the next. So if you fire up Hugs just once, type ":set -W" and then ":q" at the command line, then your preferred setting, with the "-W", should be the default you get next time you start Hugs. Actually, you shouldn't even have to do this up front ... you can probably just wait until you see the error: | ERROR "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":2 - | Syntax error in module definition (unexpected keyword "with | "; possible cause: -W option not used.) Then type ":set -W" followed by ":r" to reload. After that first time, the -W setting should again be stored for you in the registry, and you shouldn't need to specify it again. I'm hoping this behavior is still supported in recent versions of Hugs. (It is at least supported in the Nov 2002 release.) Hope this helps! All the best, Mark
Thanks Ross, Mark, and Alastair. For now I will put a note on the SOE home page pointing out the problem, for which Mark's fix is easiest (just do ":set -W", which is cached), and will wait for better resolution in a future release of Hugs. I guess I would have to agree with Alastair's arguments about that, but will let the powers that be make the final decision! :-) Thanks, -Paul
[...] Hugs used to handle all of my SOE code with no problem. Now, however, I get the error message:
ERROR "C:\Program Files\Hugs98\lib\exts\MarshalUtils.hs":2 - Syntax error in module definition (unexpected keyword "with "; possible cause: -W option not used.) [...] Of course, I could rewrite the code, but it's actually Alastair's code, and I'm not sure how big of an effort it is...
The error report comes when loading MarshalUtils.hs which is one of the new standard FFI libraries and defines a function called 'with'. It's an incredibly useful library that would be painful to avoid. I'd say the problem is in Hugs. Why does it have a setting which prevents it from being able to load standard libraries? It's now something like 2 years since we agreed to change the syntax, isn't it time that we removed support for the flag from the compiler? I vote for eliminating the +/-W flag. -- Alastair Reid www.haskell-consulting.com
On Thu, Sep 18, 2003 at 05:37:34PM +0100, Alastair Reid wrote:
I'd say the problem is in Hugs. Why does it have a setting which prevents it from being able to load standard libraries? It's now something like 2 years since we agreed to change the syntax, isn't it time that we removed support for the flag from the compiler? I vote for eliminating the +/-W flag.
The version in CVS has -W as the default -- if only it could get released.
On Thu, Sep 18, 2003 at 05:37:34PM +0100, Alastair Reid wrote:
The error report comes when loading MarshalUtils.hs which is one of the new standard FFI libraries and defines a function called 'with'. It's an incredibly useful library that would be painful to avoid.
I'd say the problem is in Hugs. Why does it have a setting which prevents it from being able to load standard libraries? It's now something like 2 years since we agreed to change the syntax, isn't it time that we removed support for the flag from the compiler? I vote for eliminating the +/-W flag.
Jeff Lewis likes the 'with' keyword and wants to keep the option of +W (though off by default).
participants (5)
-
Alastair Reid -
Mark P Jones -
Paul Hudak -
Ross Paterson -
Sven Panne