Sun Jun 1 11:13:26 CEST 2008


try meta level here: i'm loosing oversight because it's not working: i
can't make small changes to see how they propagate through a working
system. the real problem that started this is the inability to define
parsing macros, which lead to a realization that these need to be
instantiated before the rest of the code is parsed (chicken / egg
problem) which lead me to think that this is impossible unless some
form of partial expansion is used, which is then made difficult by the
way parsers are implemented: by directly calling them.

in short:

problem A:

 it's difficult in the previous setting to get to a structure
 where the 'define-syntax' occurances can be isolated before they are

 it's easy to solve this by requiring them to occur in different files.

problem B:

 it's currently not possible to include a forth file because the
 module expander is not factored properly.

let's tackle B  first.

what's wrong with current forth-module-begin-tx macro? the whole
register-code! business is not so good. a forth: macro should take an
extra argument to represent the instantiated macro.

'register' is used in the macro expansion to store the word struct
produced by the wrap operation. 'compile' produces the code graph. the
problem is: i'd like these to be composable from different sources, so
a chunk of forth code needs to produce something that can be
accumulated later into something else.

the idea is correct, only the implementation is clumsy: instantiation
needs to be solved at a single place, then forth syntax needs to be
built on top of it.