bugs

Sigbjorn Finne sof@galois.com
Thu, 14 Nov 2002 10:01:29 -0800


Hi,

interesting usability issue. The behaviour of the :load command
you're seeing is intentional, but arguably a bit confusing. When you
do

   :load Fact.hs

Hugs will only look in its current directory for the _file_ Fact.hs, and
fail
if its not there (the current directory in your case is probably the
desktop -- use the ":!cd" command to find out.) However, if
you do

   :load Fact

it will look along its module search path for the _module_ Fact, which
includes
the lib/ directory where it'll find Fact.hs. i.e., the :load command is
really
two operations rolled into one, file and module loading.

If file loading also consulted the module search path, you wouldn't have
run into this distinction, so perhaps modifying Hugs to do just that would
be worthwhile.

--sigbjorn

When you double-click, you're effectively doing

  :load "c:/Program Files/Hugs98/lib/Fact.hs"

which is why it loads up the file OK.

----- Original Message -----
From: "li wei" <liwei_uk@hotmail.com>
To: <hugs-bugs@haskell.org>
Sent: Thursday, November 14, 2002 08:35
Subject: bugs


> Hello, I just download the Hugs 98 Version: Dec 2001 for windows
>
> All the hs files are in the C:\Program Files\Hugs98\lib
> I put your excample Fact.hs in it as well, but I could not load it if I
use
> the
> "WINHUGS", or "Hugs(Hugs mode)" or "Hugs(Hugs98 mode)" which appears in
> start->program->Hugs98
>
> the message of it is
>
  ...
>
> Reading file "C:\Program Files\Hugs98\\lib\Prelude.hs":
>
> Hugs session for:
> C:\Program Files\Hugs98\\lib\Prelude.hs
> Type :? for help
> Prelude> :load Fact.hs
> Reading file "Fact.hs":
> ERROR "Fact.hs" - Unable to open file "Fact.hs"
> Prelude>
>
> //////////////////////////////////////////////////////////////////////////
>
> But if I just click the Fact.hs file , it works fine,
> do you think it is your bug or I did not set up the
> hugs correctly?
>
> yours sincerely
> Helen
>