[plt-scheme] Controlling execution in macro defining macros

From: Noel Welsh (noelwelsh at yahoo.com)
Date: Thu Jun 24 07:57:58 EDT 2004

--- Ryan Culpepper <ryan_sml at yahoo.com> wrote:

> I think you just need to create a let-bound variable to
hold the
> evaluated parameter list and then use that variable. Your
code is
> duplicating the expression code by using the inner
macro's pattern
> variables multiple times. Here's how I would write a:

Thanks.  Your suggestion works, though I don't understand
the pattern (_ actual (... ...)).  If I'm reading the docs
correctly (... ...) is a PLT extension to syntax-rules
that creates a pattern variable called ... that matches 0
or more times.  I don't understand why this is necessary,
as opposed to (_ actual ...)

Anyway, in the real code I wanted an optional message
argument at the end so I created a bunch of gensyms for
the actual arguments.  Your advice put me on the right
track for this.  The finished macro is the new
define-assertion macro in the SchemeUnit 2.0 alpha 1
release, which should be available by the time you read


Email: noelwelsh <at> yahoo <dot> com
Jabber: noelw <at> jabber <dot> org

Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Posted on the users mailing list.