Subject: Re: if statement in Gofer

> 
> Does Gofer allow only a full "If statement"?

Yes

> I didn't want "else part", so wrote :
> 
>         if i>=0 then ....

But, you always *do* want an else part!
Remember, it's an if-*expression*, not an if-*statement*.

> Do we always need to write  if __ then ____ else ____ , even if nothing is
> needed in the case of "else" ?

Yes. All expressions must evaluate to some value. 
If there's no else part, then there will be
expressions without values:

?   5 + if False then 3

Since the conditional expression "if False then 3" evaluates
to "nothing", we get

?   5 + 

which doesn't have a value!

/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
___________________________________________________________________________