Mon Apr 7 10:57:55 EDT 2008


so, with meta quoting out of the way, the real problem can come back
now: computing with word labels. this probably boils down to giving
TICK the proper semantics.

     ' foo

this will produce a literal with a quoted macro. all symbols in
macro/forth code need to be macros, and quoting symbols needs a
different tick.

what does it mean to quote a name? it produces a literal value that
supports an 'unquote' operation.

in addition: it MIGHT support POINTER MANIP if it is a macro that
wraps a call to a word.

so: the previous approach of treating symbol names as word addresses
IMPLICITLY dequotes it to yield a numeric address value.

anonymous macros might be convenient. anonymous words also. what's the

let's see:

      ' foo compile    ==   foo

this is an important issue, and needs some more thought. the
difference between "execute" and "compile" should be cleared up also.

looks like i really need to be careful with AUTOMATIC changes between
macros and words.

NOTE: macros can't survive to the assembly phase, so everything that
used to be a symbol, now needs to be a target-word struct.

does this solve it?

 ;; Get the address from the macro that wraps a postponed
 ;; word. Perform the macro->data part immediately (as a type check)
 ;; and postpone the address evaluation.
 (([qw macro] address)
  ([qw (let ((word (macro->data macro 'cw)))
          (let ((pointer
                 (target-word-address word)))
            (unless pointer
              (error 'unresolved-word "~s"
                     (target-word-name word)))

looks like it: 'run' and 'address' are now separate. 'run' doesn't
need to know if the quoted macro represents a target word. 'address'
does need to know that, and fails if it is not.