| I have a little patch which introduces a syntax I've been calling "mz" which causes its contents to be passed unchanged through the Arc compiler. For example, if I say (mz (+ 1 2))
and I look at Arc's compiler output, the "(+ 1 2)" appears literally, and thus what I get is MzScheme's "+" being applied with an MzScheme function call to 1 and 2.This lets me embed a bit of MzScheme inside of my Arc program. It can be used for some of the same tasks that Anarki's "$" macro (which lets you eval some MzScheme code) is used for, but also gives the bit of MzScheme code access to local lexical variables. (let a 4
(mz (+ a 3)))
Naturally, what this does depends on the precise details of what the Arc compiler is generating, and thus will most likely be even less stable than the Arc language. Still, for quick hacks it's a fast way to get at some bit of MzScheme functionality.That's all great, but I don't think the name "mz" that I've been using is a very good name. What the syntax does is cause an expression to pass through the Arc compiler unchanged. In a way it's like a form of quoting... A regular quote like '(+ a 3)
protects the expression from being evaluated. This compiler quoting form protects the expression from being compiled by the Arc compiler. Which has nothing to do with MzScheme ("mz") particularly.Thoughts? |