Fri Aug 10 10:23:06 CEST 2007
pattern transformer extensions
I'm trying to perform the pattern extensions properly. A true test
about this phase separation thingy, since i have a couple of phases
0 matcher runtime
1 execution of pic18-pattern transformer
2 execution of pic18-pattern transformer generator
an extra problem is that i'm matching transformer names -> syntax
this gets a bit complicated, because the name of the pattern
generator, i.e. 'unary->mem' is used both as a macro template, and as
a function name, so the transformer generator needs to be generated!
too many levels of nesting: this has to be simplified somehow..
the thing that needs to be generated is a pattern expander function,
which can be used in pic18-comp.ss to create the extended compiler-pattern
ok, i'm running into the problem again: if i put pic18-meta-pattern
and pic18-process-patterns in a different module, and
require-for-syntax it, i get the #%app error again..
so until i figure that out, maybe best to always use local transformer
i guess it has something to do with binding identifiers. here the
problem seems to be 'lit'. in the binary-2qw pattern..
i ran into the problem again, in pattern-utils.ss /
extended-compiler-patterns and it was something like:
#`(namespace . #,( ---- ))
which needs to be
#`(namespace #,@( ---- ))
because the #, expands to an s-expression, which is then just inlined
too, leading to 'process-patterns' not being quoted. weird stuff can
happen.. ALWAYS CHECK EXPANSION when this #%app thing occurs!
wait.. that's not it.. damn!
i'm going to leave it at not using any syntax for it.. it's not too
bad, and understandable.