Sun Jun 3 21:49:49 EDT 2012
Symbolic target words
Instead of using a bunch of codes, it's probably simplest to call host
code using symbolic names, and using the same approach as those
(non-parsing) words run from the command line.
What this needs is the following interface:
>h h> move words to host stack
#xFE [ <char> ... ] execute target word
Maybe all RPC code should drop into interpreter?
EDIT: done, looks better.
Next: where is the live: state stored (stack)?
grep for "state:stack" in staapl/staapl/live
./rpn-target.ss:85: (void ((target: code ...) (state:stack))))
So it looks like I need to open up this one:
(define-syntax-rule (target> code ...)
(void ((target: code ...) (state:stack))))
Is it target: or live: ?
reflection.ss `run' delegates to `forth-command' defined in
rpn.target.ss in terms of `target:' to interprete commands. So do we
want the target to have acess to that or only the `live:' set?
The namespace used by 'live:' is defined by `live-interpret' in
rpn-live.ss, and it will take words from the (scat) namespace but
delegate to scheme usoing `scat-wrap-dynamic'.
EDIT: Actually, this should probably be `target-interpret' instead of
That works, but it creates loops: `target-interpret' gives preference
to target words, so this needs to be broken.
I don't see how to fix it. `kb' is a 1cmd: in the (target)
dictionary, which is implemented as a prefix parser.
so "kb" -> "t> kb", where 'kb' is then interpreted in (target) which
delegates to target word.
Maybe this needs a more systematic approach. Instead of delegating to
host commands from .f code, make it so that all host commands are
accessible on the target.