[plt-scheme] Macro Problem

From: Bill Wood (wtwjek at winternet.com)
Date: Fri Mar 28 21:37:26 EST 2003

Ryan Culpepper wrote:
  . . .
> One way to work around this is to collect the (var ...) as a single
> pattern variable using a helper macro. Try the following:
  . . .
> Does that do what you wanted?

This appears to do *exactly* what I wanted, though I'll obviously do
a lot more testing before I'm completely satisfied, partly to ensure
that I understand what the fix does.  Many thanks Ryan!.  BTW am I
to understand the the underscores ("_") appearing at the start of a
pattern flags the fact that that keyword "... is not involved in the
matching ..." (R5RS, p.32)?

Also, I'd like to thank Eli Barzilay for his thoughts.  I surmise
that his comments explain why the helper macro is necessary.  He
does bring up an interesting question:  Since several implementations
disagree on how to handle my  original definition, is there in fact
some ambiguity in the semantics of the matching rules?

Finally, Eli's comment on relative clarity is apropos:  I deliberately
chose a minimal form on the grounds it would be easier to expand; I
may add some syntactic sugar later.  On the other hand, you might
notice that my minimal form is not all that far from the standard "do"
iteration form:  the differences are that the condition has been
dropped from the termination form and the general "do" body has been
replaced by what amountsd to the body of a "cond".  Discussion of
the relative merits of the computational pattern would be interesting,
but perhaps should be in a separate thread.

 -- Bill Wood
    bill.wood at acm.org


Posted on the users mailing list.