[plt-scheme] sytnax macro question

From: David Van Horn (dvanhorn at cs.uvm.edu)
Date: Sun May 11 16:15:57 EDT 2003

I wrote:

> From The Scheme Programming Language page 168:  http://www.scheme.com/tspl2d/
> 
>    (syntax-case exp (literal ...) clause ...)                syntax
> 
>    Each /literal/ must be an identifier.  Each /clause/ must take one of the
>    following two forms:
> 
>    (pattern output-expression)
>    (pattern fender output-expression)

I thought that it would be straight-forward to define a variation on
syntax-case that didn't use fenders and allowed for multiple
output-expressions, ie /clause/ is of the form (pattern output-expression
...), but I can't seem to make it happen...  Here is my naïve implementation:

 (define-syntax my-syntax-case
    (syntax-rules ()
      ((_ exp (literal ...) (pattern output-expression ...) ...)
       (syntax-case exp (literal ...)
         (pattern (let () output-expression ...)) ...))))

Could someone help me out?  TIA.

-d




Posted on the users mailing list.