[plt-scheme] exception occurs in Expander

From: Bruce Hauman (bhauman at cs.wcu.edu)
Date: Sun Jan 12 16:46:25 EST 2003

I was wondering if anyone could help me understand this exception
that only occurs when I am using the Expander language option in
DrScheme 203 on linux.

syntax: no pattern variables before ellipses
        in template in: (id c1 c2 ...)

(define-syntax cond
  (lambda (x)
    (syntax-case x ()
      ((id c1 c2 ...) ;; <- Right Here
       (let f ((c1 (syntax c1)) (cmore (syntax (c2 ...))))
         (if (null? (syntax-object->datum cmore))
             (syntax-case c1 (else =>)
               ((else e1 e2 ...) (syntax (begin e1 e2 ...)))
               ((e0) (syntax (let ((t e0)) (if t t))))
               ((e0 => e1) (syntax (let ((t e0)) (if t (e1 t)))))
               ((e0 e1 e2 ...) (syntax (if e0 (begin e1 e2 ...)))))
             (with-syntax (((car-cmore . cdr-cmore) cmore))
               (with-syntax ((rest (f (syntax car-cmore)
                                      (syntax cdr-cmore))))
                 (syntax-case c1 (=>)
                   ((e0) (syntax (let ((t e0)) (if t t rest))))
                   ((e0 => e1) (syntax (let ((t e0)) (if t (e1 t) rest))))
                   ((e0 e1 e2 ...)
                    (syntax (if e0 (begin e1 e2 ...) rest))))))))))))

Bruce Hauman

Posted on the users mailing list.