Wednesday, February 11, 2004
interpreter progress
okay, well, things went well with the stack based implementation. as greg notes, it made things *this* much easier.
quoted expressions
i met with miles yesterday's yesterday and we talked over how we each put our interpreters together. two things came up,
for instance, does 'dog
evalute to the regular symbol dog
or to a
special type of literal symbol dog? what did miles mean by literal?
well, i think he meant that there was a difference between variables and
|literal symbols| in that if a variable was evaluated it returns whatever it's
bound to whereas if a literal symbol is evaluated it returns itself. so the
evaluation of the evaluation of 'dog
should return the literal symbol
dog
according to miles? i dunno.. sounds confusing. maybe it'll make
more sense when i get into macros and quasiquotation.
next up
next up is getting macros working. i read over the appropriate bits in R5RSand it seems clear enough. a macro definition is like a closure, but its evaluation results in an expression to be evaluated, and that expression comes from transforming the macro template. i was more than a little confused by greg's description of templates yesterday because he was introducing quasiquotation at the same time -- which makes sense since i imagine that dealing with quasiquotation inside a marco template brings out all the questions of how macro templates are transformed. well, more on this later when i step through the spec in more detail.
i'll also read up on macros in C. something i've only barely messed with to use wxWindows. greg was pointing out some weirdness that happens with C macros... something about how the macro parameters and local variables with the same name can cause unexpected, but very unintuitive, things to happen.