Claus Reinke wrote:
Wed Jul  9 04:08:30 PDT 2008  Simon Marlow <[EMAIL PROTECTED]>
 * #1205: ':load foo.hs' in GHCi always compiles to bytecode
So now :load foo.hs loads bytecode for foo.hs, even if foo.o exists
   :load foo          is just shorthand for :load foo.hs
   :load M            loads a module M, as object code if possible
                      (no change here)

If the first two are the same, what is the distinction between the last two? In other words, what happens if module M is in file M.hs?

euch. I've just realised things aren't the way I thought they were. I hate heuristics.

So currently if you say

 :load M

and M.hs exists in the current directory, then that is the same as saying

 :load ./M.hs

which is almost certainly not what we want. I think we should only try adding ".hs" if the string is not a valid module name, because if it *is* a valid module name, then we'll find the source file via the usual module-finding semantics.

In which case, to answer your question, the last two cases would be distinguished by the fact that "M" is a valid module name, but "foo" is not.

This would seem a simpler specification, but it would rule out
case 3 above.
In the use case of one module interpreted for debugging/inspection, everything else compiled, one often has to do a make to generate all object code in a consistent fashion, but one still wants to load a few modules at a time interpreted in GHCi, with their imports
loading compiled. Does that still work?

sure - as long as you let GHCi find the modules itself, rather than supplying all the filenames, for the ones you want to load compiled.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to