[Removed haskell list from cc line - questions about Hugs should be 
sent to a Hugs specific mailing list.]

>   1. When running "winhugs.exe", how does one set the "{Hugs}" parameter
> which appears
>      under Options?  The string I see is 

On Windows, the {Hugs} value is automatically the directory in which
the executable program lives.  If this is inappropriate for some
reason, you can replace {Hugs} with a hardwired string yourself using
:set in the normal way.  (On Unix, the path gets hardwired at
configure time.)

It'd be nice to have a general mechanism for defining other variables
but I couldn't find a design I liked.  

On Unix, it's quite easy to create a shell script along the lines of:

  #! /bin/sh
  Xlib     = $HOME/projects/X11/src
  Graphics = $HOME/projects/Graphics/src
  Utils    = $HOME/projects/utils

  hugs -P$Xlib:$Graphics:$Utils: $*

which gives you almost what you want (a little less convenient to
change but easy to have different settings for different projects.)

I believe you can do something like this on Windows too but I'm not
an expert on .bat files.  (If you have Perl, it'd be really easy.)

>     Putting lines like the following in my "autoexec.bat" file does not
> seem to help, and
>     they are probably overridden by the Windows Registry anyway.
> 
>       HUGS=\fp01_\fp22.ins\hugs98
>       HUGSPATH=\fp01_\fp22.ins\hugs98\lib;\fp01_\fp22.ins\hugs98\
>       HUGSEDIT=notepad

The code that read this in looks like this:

    hugsEdit      = strCopy(fromEnv("EDITOR",NULL));
    hugsPath      = strCopy(HUGSPATH);
    readOptions("-p\"%s> \" -r$$");
    projectPath   = strCopy(readRegChildStrings(HKEY_LOCAL_MACHINE,ProjectRoot,
                                                "HUGSPATH", PATHSEP, ""));
    readOptions(readRegString(HKEY_LOCAL_MACHINE,HugsRoot,"Options",""));
    readOptions(readRegString(HKEY_CURRENT_USER, HugsRoot,"Options",""));
    readOptions(fromEnv("HUGSFLAGS",""));
    for (i=1; i<argc; ++i) {            /* process command line arguments  */
      if ("isAnOption") {
        processOption(argv[i]);
      }
    }

That is, it first sets the editor, path, prompt and repeat string.
Then tries to override these values with values from the registry then
with HUGSFLAGS environment variable then withcommand line options (if
you invoked Hugs from a shell.)

I haven't looked at this code in a while but it looks like HUGSPATH is 
serving two roles: as the project path and as the module search path.

Also, unless you included some strategic ";"'s in the path in the registry,
the value obtained from HUGSPATH will be discarded.

Finally, if you want a setting that can't be overridden by the
registry, you should set it in HUGSFLAGS (ie use the -P command
option).

>       "We are currently developing a more traditional windows interface to
>       the Hugs compiler, hugsedit.  Look on haskell.org/hugs for the latest
>       information on this.  Unlike winhugs, hugsEdit is a separate program
>       which calls the console version of Hugs as a subprocess.  "
> 
>    Does "hugsEdit" exist?  

"We" refers to Yale.  As far as I know, that project has been abandoned
- the documentation should be changed to reflect this.

I think there are plans to produce something equivalent to HugsEdit
but I can't guess the timescale.

> What is the best way to run Hugs under Windows 98?

Depends on what you're trying to do and personal preference.
I find that invoking plain old Hugs from a shell window is very effective.
Others find winhugs easier to use.

--
Alastair Reid

Reply via email to