running Hugs98 sept 2006 version, on AMD 64-bit OpenBSD 4.0, test :: Int ERROR - Undefined variable "test" size = 12+13 ERROR - Syntax error in input (unexpected `=') These lines are right out of _The Craftf of Functional Programming_, 2nd Edition, which I just received in the mail. Is Hugs98 broken on my system? Thanks, Dave Feustel
On Saturday 24 March 2007 16:48, Dave@haskell.org, Feustel@haskell.org wrote:
[...] Is Hugs98 broken on my system?
No. What you can enter at the prompt are either Haskell expressions or Hugs commands (use ':?' to seem them all). 'test :: Int' is an expression, but if you haven't loaded any script, test is undefined, and Hugs is telling you that. 'size = 12 + 13' is not an expression, but the definition of the value of 'size', and you can't do this on the prompt. Put that into a file and load it via :l, and this should make Hugs (and you ;-) happy... Cheers, S.
Hi
Is Hugs98 broken on my system?
No
test :: Int ERROR - Undefined variable "test"
This defines the name test to be an Int, but what is test? Have you introduced it earlier? Try instead:
1 :: Int
size = 12+13 ERROR - Syntax error in input (unexpected `=')
You can't do that at the hugs prompt, but you can in a file. In a command prompt perhaps: let size = 12+13 in size Thanks Neil
participants (3)
-
unknown@example.com -
Neil Mitchell -
Sven Panne