[plt-scheme] defining a lisp dialect via mzscheme extensions that provides define-macro

From: Eli Barzilay (eli at barzilay.org)
Date: Wed Feb 6 14:07:18 EST 2008

On Feb  6, Neil Van Dyke wrote:
> I've implemented most of a certain Lisp dialect as a DrScheme/MrEd
> Language by extensive use of MzScheme "define-syntax", custom
> "#%app", and reader tweaks.
> The only thing I'm stuck on is how to get the language's "defmacro"
> to work using "defmacro.ss", given MzScheme's respect for phase
> separation.
> The toy code below illustrates my current approach.
> Any thoughts on how to get the body of "toy-macro" to be in language
> "toylang"?

I'm not sure what the problem is exactly -- you say above that it's
mzscheme's phase separation (which has no real solution except for
something like use eval (eg, arc)).  But in your code it seems that
the problem is that you don't get the right set of bindings in the
macro level -- for that, you'll need to also redefine
`#%module-begin', since the usual one requires mzscheme for syntax.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.