Re: [colorforth] an observation
- Subject: Re: [colorforth] an observation
- From: Samuel Falvo <falvosa@xxxxxxxxx>
- Date: Tue, 19 Aug 2003 13:24:05 -0700 (PDT)
> I've noticed the number of returns far outweigh the ocurance of fall
> through. Notationally, it would be more efficient to make return implicit
> and fall through explicit. In this case red words would denote the ending
> and begining of definitions, also 'then' would compile a return and the
> null token would as well.
I often make use of constructs such as this:
condition IF optionalAction THEN requiredAction
I was considering re-introducing ELSE into my interpretation of the language,
like this:
condition IF action1 ELSE action2
where ELSE is defined more or less like this:
COMPILER
: else postpone exit postpone then ;
So basically, THEN would permit conditional fall-through, while ELSE provides
true alternation. It also makes more sense from an English reading
stand-point, I think.
> Is this a good idea or a trivial variation? I think it would reduce errors
I think it could potentially be a good idea, personally. One could use an
ellipsis ('...') to flag the compiler, "and then, I want you to do this..."
Example:
: 256* 4* ...
: 64* 4* ...
: 16* 4* ...
: 4* 2* 2* ;
--
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