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

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


A simpler way would be to reprogram "then" to read "endif"

: testproc w1 if w2 endif w3 ;

: testproc2 w1 if w2 else w3 endif w4 ;

----- Original Message ----- From: "Albert van der Horst" <albert@xxxxxxxxxxxxxxxxxx>
To: <colorforth@xxxxxxxxxxxxxxxxxx>
Sent: Sunday, November 02, 2008 7:47 AM
Subject: Re: [colorforth] if then else - but why is there no ?else? in colorForth?


On Tue, Oct 28, 2008 at 06:21:13PM +0000, Jason Kemp wrote:
<SNIP>
>
>    But is this what is meant by "if-else-then" ?
Not quite what I mean.  This is so hard to explain and I have spent
literally hours over this.  I have never given ?if?s any thought in
other languages.  Who says colorForth is simple?

in this example
  : w1 if w2 then w3 ;
the if the ZF is not set then w2 will execute and then w3 will too.  If
the ZF is set then only w3 goes.

Chuck Moore wanted to have if a meaning by itself. The same for
then.
Read this if you will:
  conditional: w2  then-goon-with w3 ready

in this one:
  : w1 if w2 ; then w3 ;

Now this makes sense too
    conditional: w2 ready  maybe-goon-here: w3 ready



Still perplexed,
Jason


--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- like all pyramid schemes -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst

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