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

Re: [colorforth] Dare I say ANS!


On Friday 16 January 2004 10:41 am, Albert van der Horst wrote:
> I dislike INVERT because it very verbose, but it is ISO
> Is - a monadic ( a -- ) operator in colorforth?

To replicate ColorForth's - in ANSI Forth:

: - -1 XOR ;

Remember that Chuck's ColorForth's foundation is MachineForth.

> > mark          gild
>
> Don't know either word, but GILD is not ISO

The closest ANSI word to mark is 'marker'.  In fact, I use these GForth 
(ANSI Forth) definitions all the time in my work:

: mark s" marker _empty_" evaluate ;
: unmark s" _empty_" evaluate ;
: empty unmark mark ;    

> I doubt this. How can the current loop index be
> different from I. It is like saying Ilias was not written
> by Homer, but by a guy of the same name. (For the
> classic-impaired, we don't know anything of Homer, except
> that he wrote the Ilias.)

The ColorForth I returns a 1-based loop count.  DO/LOOP need not 
necessarily be based at zero OR at one; indeed, I could just as easily 
be memory addresses.  Hence, both arguments are invalid.  There is zero 
analog between DO/LOOP and FOR/NEXT unless you explicitly restrict the 
DO-loop's base argument to one, in which case, I is just I.

> > ?dup          ????
>
> ?DUP is ISO

Sure it's ISO, but it's not part of the compiler's peep-hole optimization 
scheme.  However, I would like to point out that Chuck doesn't 
particularly like words that return a variable number of results on the 
stack.  Indeed, they put dataflow-based optimizers into fits.

--
Samuel A. Falvo II


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