Wed Mar 26 19:58:11 EDT 2008
name generating words
it's all about names now.. the next things to tackle are name
generating words. let's start with 'constant'.
this needs to create a macro eventually. i eliminated this before
because of the awkward reflection loop. is that still a problem?
yes. it's a phase mix that can't be resolved, because "free-range"
code is no longer allowed. so, no constant: use macros instead.
then 'variable'. there's little trouble here, except that it requires
address resolution, so qualifies as a word.
so.. what does variable expand into? maybe a forth-word? let's see if
forth-rep.ss can be extended to represent variables.
maybe it should get its own representation, next to forth and macro?
a variable is a macro that compiles a reference (as literal) to a word
structure. so in some sense, it is a forth word: the defining property
of a forth word being: need for allocation of memory.
so what does a variable look like?
(make-word (scat: ',var-struct literal))
this var-struct should also be a word struct, so it can be registered
in the same way as forth words. however, the normal 'forth' wrapper
expression isn't really useful here. so it might be necessary to
change that a bit.