[plt-scheme] Problem with define-syntax and class*

From: Anton van Straaten (anton at appsolutions.com)
Date: Tue Dec 6 11:51:15 EST 2005

Dave Gurnell wrote:
>> (define-syntax make-tag
>>   (syntax-rules ()
>>     [(make-tag tag-class tag-attributes tag-body)
>>      (new tag-class ,@(tag-attributes) [body tag-body])]))

The unquote-splicing operator (,@) isn't meaningful in a syntax-rules 
macro.  You need to use pattern matching, e.g.:

(define-syntax make-tag
    (syntax-rules ()
      [(make-tag tag-class (tag-attribute ...) tag-body)
       (new tag-class tag-attribute ... [body tag-body])]))


Posted on the users mailing list.