home .. forth .. colorforth mail list archive ..

Re: [colorforth] if then else - but why is there no ?else? in colorForth?


Hm.

Maybe what you want is "IF(", ")ELSE(", and ")ENDIF".

"(" and ")" are already in use, for stack comments, and I'd rather not overload ")".

----- Original Message ----- From: "Jason Kemp" <jason.kemp@xxxxxxxxxxxxxxxx>
To: <colorforth@xxxxxxxxxxxxxxxxxx>
Sent: Monday, November 03, 2008 11:01 AM
Subject: Re: [colorforth] if then else - but why is there no ?else? in colorForth?


Hi John,

John R. Strohm said the following on 02/11/2008 14:05:
A simpler way would be to reprogram "then" to read "endif"
That had me for a while. The way ‘if’ and ‘then’ are used in Forth seems so wrong when you’re used to other languages. A newbie expects the condition between ‘if’ and ‘then’ and the conditional action after the ‘then’. The stack messes up this idea. The Forth ‘if’ is actually the ‘if’ and ‘then’ of other languages combined.

Another way could be using brackets: ‘if(’ and ‘)’. That might be easier to read.

OK. I’m sick of if now.

Jason



---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com






---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com