Sun Mar 23 13:52:01 EDT 2008
not currently transforming
PROBLEM: not being able to run the transformers because they depend on
some expander environment is problematic. i'm using some functions
that use context only available in `official' transformers. fix that.
EDIT: this is not just 'some expander environment'. it's the lexical
environment of the expression being transformed. also see entry about
calling macros directly. entry://20080325-144330
in other words: is it possible to turn a function into a transformer?
this requires some level shifting voodoo i don't see how to perform..
(define-syntax transformer (lift tx-fun)) ?? too simple to see ??
EDIT: looking at plt/src/mzscheme/src/env.c -> now_transforming
(syntax-transforming?), this predicate is derived from the presence of
a scheme_current_thread->current_local_env value.
in eval.c -> expand the function _expand is called with a new expander
hmm.. too complicated to quickly browse. what i did see is that the
environment during an expansion is ether dynamic, or attached to the
stx objects. the latter makes sense, but i can't see any obvious
refs.. the magic is done in resolve_env, which is quite
complicated. it looks as if the info is not tied to the objects..
so guesswork: the expander has a dynamic environment which contains
the lexical environment of an expression.