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

Re: [colorforth] an observation


> This syntax hides ; in else,  red words, every structure word  added to
> colorforth.

The only true statement in the message.  How fortunate, then, that ColorForth
has very few structure words in it.  I can only think of a couple:

 * else
 * Red-word

At this time, I seriously cannot think of any other structure word in
ColorForth.

>  adds  test for "..."  in  ;  making  a  hidden word more complex.

False.  The test for the previous '...' occurs only in the handler for red
words.  It need not exist anywhere else, for it makes sense in no other
context.

>  The else then  construct allows  complex structures to reside in one word.

True, as far as the if/else/then approach goes (and even then, it's not THAT
hard.  I've written four classical Forths, working on my fifth, if/else/then
really is one of the easiest things to get working).  But, how fortunate, we're
not talking about supporting if/else/then.

False as far as the original context of the discussion is concerned.  I posted
the code for implementing else.  In ColorForth, here it is:

  macro else ; then forth
  ^^^^^ ---- = ==== ^^^^^

where ^ indicates a yellow word, - indicates a red word, and = indicates a cyan
word.  There she is, in all her simple glory.

I can do it in ColorForth now.  Nothing is made more complex.  It does make
writing if statements easier and more compact, and perhaps most importantly,
the *intent* behind the software more obvious.

> Does not force
> factoring of  logic statements.

False, on several accounts.

1) It uses the existing if/then infrastructure, it does not fundamentally
change it.

2) You can just as easily abuse the if construct in ColorForth as you can in
classic Forth:

 foo cond1 if action1 ; then con2 if cond3 if action2 ; then action3 ; then
 ---

--
Samuel A. Falvo II


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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