Hi Dave,
I see your point but I think both your alternatives would generate even
more complaints.
In version (a), we'd have to invent a whole new notion of importing and
we would not be implementing anything remotely like the Haskell report
which says very clearly that a module with no module line (and not import
line) is equivalent to:
module Main(main) where
import Prelude
Note that this is just a normal "import" - no "import everything even if it's
not exported nonsense.
[Aside: I'd prefer it if Haskell didn't allow you to omit the module line - in
which case Hugs would be free to add it as an extension.]
In version (b), we'd lose the ability to evaluate things in exactly the
same environment as code from a specific module. For example, if I'm trying
to debug a program composed of modules Main, A, B and Prelude, I might
want to jump over into module A (:m A) cut/paste some code from A into the Hugs
shell and see what it does. I can do that with the current system but not with
your change.
If there's a way out of this, I'd be happy to hear it.
Alastair
> I'm using Hugs 1.4 January 1998.
>
> I'm not sure what the reports position on this is (janet web cache
> refuses to acknowledge haskell.org at the moment) but from a using hugs as
> a scripting language point of view...
>
> I know foldl' is not being exported from the prelude deliberately so it
> can't be used in a properly modularised program. And since loading a file
> with no module line is treated as defining Main, it can't be used even
> loading a simple set of definitions used for simple interactive scripting.
> But it is defined within the module prelude where hugs sits without
> anything having been loaded. (It took me a while to figure out this.)
>
> So can I suggest making a special case in one of two ways:
>
> (a) make loading a file with no module line into hugs be equivalent to
> having a module Main BUT make all names in the prelude available.
>
> (b) make hugs without anything loaded sit in a namespace which contains
> only functions EXPORTED from the prelude.
>
> For usability I'd prefer (a) but either is preferable to the current
> confusing situation.
>
> ___cheers,_dave__________________________________________________________
> email: [EMAIL PROTECTED] "I This is not a game.
> www.cs.bris.ac.uk/~tweed/pi.htm II Here and now, you are alive."
> work tel: (0117) 954-5253 -- Small Gods, Terry Pratchett
>