[plt-scheme] macrophases

From: Anton van Straaten (anton at appsolutions.com)
Date: Sun Apr 4 17:28:46 EDT 2004

If you introduce bacteria into an animal's bloodstream, the bacteria's
attempts at reproduction are thwarted by macrophages which surround and kill
the bacteria, as part of an immune response.

If you introduce functions into a macro, attempts to reuse the function may
be thwarted by macro phases which surround and kill the functions, as part
of syntax-case's immune response to my attempts to understand it.

I'm just curious, since it really doesn't matter much now that it's working:
I've posted some syntax-case code at:
http://www.appsolutions.com/code/typeclass.html

To be able to reuse the function make-prefixed-id in three places in the
define-class macro, I resorted to a separate module, imported with
require-for-syntax.  This works fine.  Before that, I tried a number of ways
to include the function definition within the define-class macro.  But since
make-prefixed-id is used at multiple levels - including within a macro
generated by the top-level macro - it seems that to make this work, a trick
would be needed that I don't know.  Is there such a trick?

Anton



Posted on the users mailing list.