Fri Apr 25 12:25:27 EDT 2008
closed or open?
the remaining question for the compiler is: how to represent
macros. are they open SCAT functions, or closed 2stack -> 2stack
functions. the problem with the latter is that it can't be composed in
the scat way.
so, let's do this: if composition in SCAT is necessary, prototype
remain stack->stack + open dynamic refs, otherwise the expressions are
closed using 'scat->2stack'
now, this has implications for the pattern transformers:
pattern-tx->macro will represent a transformer as an open SCAT
ok.. got that sorted out. see k/asm->scat in scat-2stack.ss
now it's time to get in trouble: make-split-update requires access to
the asm state, so it needs to operate on closed macros.
open macro = scat function (stack -> stack)
closed macro = 2stack -> 2stack
so, the solution is to not operate on open macros, but on closed ones:
that way the compile mixer has access to the asm buffer.
(i need some terminology cleanup)
next problem: 'with-exit' requires access to asm buffer.
maybe time for a break.. can't wrap my head around this: m-exit uses a
parameter, so can i create a mix function that references this
parameter? probably not, because the dynamic context of the mix
function is likely outside the scope of the with-mexit.
maybe the macro exit status should be hidden in the overall compile
state. alternatively: m-exit could close over the asm-buffer? i don't
really understand yet..
summarized: how do parameters and delimited continuations interact?
the problem with 'with-exit' as it is now is that without turning it
into a 2stack mixer function, there's no way to access the state.
so, bascly, i need a mixer that calls with-breakpoints. does that
work? it really should work.
what is this? local closure.
ok.. i'm going to try first to mix parameters with the breakpoint
control structure, then possibly make an abstraction for this.
got too much in my head again.. macro->postprocessor operates on
ok. i have the impression to be on the right way: this way of
composing does need a better abstracted api.
instead of using 'values' in the state update function, use a
structure type: the type has 2 values.