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

Re: [colorforth] Machineforth IFs


Machine-Forth  if  is non-destructive for 2 reasons:
     It seems that only half the  ifs  want to be destructive. ?dup is an
ugly word.
     The decoding for the  drop  instruction is already difficult. A
destructive  if  would make it more so.

The best strategy for dealing with  if  is to not use it. I think that good
code has a minimal number of conditionals. Many decisions can be made at
compile time. The vectored  jump  can replace a decision tree.

But given that you must sometimes use it, I see no alternative to sprinkling
drop  around.  On the c18, this often costs neither time nor space,
depending on instruction packing.


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