Wed Mar 3 19:15:16 CET 2010
Fixing (limiting) the assembler
This needs a fix in the `tv:' form. This is an RPN form which takes
names either from the lexical environment and lifts them as constants
or delegates to the `scat:' form.
It looks like the modification needs to be made to replace that
`scat:' form by something with a restricted functionality such that
assembler expressions can be used.
- replace tv: -> scat: delegation by something more explicit,
i.e. with an empty namespace
- add functionality to the new form until all uses are covered.
This might turn up some cross-connections at places..
( Ha! With my head in the Haskell learnings lately I forgot that I
really like Scheme macros ;)
EDIT: I've been going through the code and it seems the use of tv is
really quite limited to arithmetic expressions. And, there is already
a `partial-eval' that can pretty-print code: this is used in the repl.
Atm it seems that this can be left un-checked. Checking can be
introduced quite directly in the `tv:' macro definition, using the
`fn-no-lex' argument to `lex-mapper'.
EDIT2: Maybe it's even simpler to combine the partial eval and other
code to using abstract evaluation, instead of explicitly.
EDIT3: Or the other way around.. Encode sytax explicitly, but tag
semantics in case evaluation is done in Scheme. The unifying
principle is: we don't really have semantics in Scheme; the assembler
should be abstracted, so it needs an AST rep, not a functional one.
Here I miss Haskell type class polymorphism. But maybe other forms of
polymorphism can be used. Swindle?