You. Forth. Simplicity.

git repository
download
prior releases
documentation wiki
issue tracker
mailing list and forum
irc channel and logs
try it


This wiki remains, like the original forum, mainly for historical value. There is a new wiki which, while having less content, is more secure and oriented towards modern Retro implementations.

reload node | edit | recent changes | front page

Deferred Sequences

Another important language element is deferred sequences of code. Some words, specifically the parsing words, like is and devector, can not be directly used in a definition. To get around this, a common approach is to use a string and evaluate it:

: foo ['] clear s" is bar " eval ;

RetroForth supports this with the { ... } structure. Code between { and } is interpreted when the word is run. So the above example could be done as:

: foo ['] clear { is bar } ;

This does have one significant limitation: you can not nest deferred sequences. Other than that, it should be quite useful in a variety of situations. You may also use these in .self or .macro class words since the evaluation process does not change the compiler state.