Subject: Re: more questions on gofer

> 
> Q1. I'm trying to display back the input that user entered, i.e.  printing
> error message like "N is out of range"  ( N is the number user entered.)
> I usually read input into a variable and print it out with Pascal.  But
> gofer doesn't seem working like that.  How can I do it?

fun 0 = 45
fun 1 = 56
fun n = error (show n ++ " is out of range")

error is a function which terminates the evaluation
and prints its argument (a string).

> Q2. Can we declare constants with gofer?

A function that always returns the same 
values is equivalent to a constant.
Example:
   pi :: Float
   pi = 3.14159265

/CC

___________________________________________________________________________
Christian Collberg      | Email: c_collberg@cs.auckland.ac.nz
Computer Science Dept   | Fax:   +64-9-373-7453
University of Auckland  | Phone: +64-9-373-7599 x 6137
Private Bag 92019,      | WWW:   http://www.cs.auckland.ac.nz/~collberg/
Auckland, NZ            |
___________________________________________________________________________
"Education is an admirable thing, but it is well to remember from time
to time that nothing that is worth knowing can be taught." - Oscar Wilde
___________________________________________________________________________