Hi Vincenco,
>>>>> "Vincenzo" == Vincenzo Ciancia <[EMAIL PROTECTED]> writes:
Vincenzo> I launch hugs in Haskell98 mode, it prompts me with
Vincenzo> "prelude>" and lets me do nice things, but not
Vincenzo> x=3
Vincenzo> or
Vincenzo> f x = x
Vincenzo> while I can do, instead, let x=3 in ... Why?
I'm not sure whether a fundamental reason is an issue for excluding
this from the interpreter, but there is a simple practical point.
Usually you want to write several definitions and they are all gone
when you terminate the session. Therefore, it's always better to write
top-level definitions like the ones you stated above in
a script file, e.g., "test.hs" and load it with ":l test.hs" in
the interpreter. Then, these definitions are used while evaluating small
expressions. On a workstation where you can have editor and shell window
next to each other the turnaround times are even faster than by making
definitions in the interpreter.
Vincenzo> SAME TIME!) Should I always do a "let x=3 in..." in all
Vincenzo> my code (or at least when I want x=3 of course!:)
Only where you want it, but it doesn't harm as long as you don't use "x".
Vincenzo> Another question: in interactive mode, is there a way to write
Vincenzo> more than a line without beeing "evaluated"?
No, I don't think so, but I'm not sure.
Vincenzo> I can't bear
Vincenzo> a lazy language being so eager in evaluating me :)
Laziness means that Haskell does nothing more internal computation than
absolutely necessary to compute the answer for the user.
Cheers, have fun with Haskell.
--
Christoph Herrmann
E-mail: [EMAIL PROTECTED]
WWW: http://brahms.fmi.uni-passau.de/cl/staff/herrmann.html