[DEFINED] token
searches for token and if in scope returns TRUE.
[UNDEFINED] token
searches for token and if in scope returns FALSE.
Today I found myself doing the following for a compilation parameter
where I wish to escape to a default if the compilation parameter is
not defined, but also wish to allow the compilation parameter to be
set to FALSE to drop through the the same default.
This results in:
[DEFINED] no-sp-large [IF] no-sp-large [IF]
\ simpler definitions if large shuttlepads are excluded
[ELSE]
\ more complex definitions if large shuttlepads are allowed
[THEN] [THEN]
.... and it occurred to me that it would be straightforward to search
for the word and execute it if found, returning FALSE if not found ...
so that intrinsically, if its a VALUE or is a dynamic check whether
something is sup****ted, it will be defined to return FALSE for the
default case. Such a word might be called [OPTIONAL]
[OPTIONAL] no-sp-large [IF]
\ simpler definitions if large shuttlepads are excluded
[ELSE]
\ more complex definitions if large shuttlepads are allowed
[THEN]
.... however, if I ran a benefit from it, I am confident others have,
and it is just a small wrinkle on the vanilla Forth-94 standard for
[DEFINED], so I was thinking that it was probably a Comus-type word.


|