define-macro.scm 484 B

12345678910111213141516
  1. (module define-macro (define-macro)
  2. (import scheme
  3. (chicken base)
  4. (chicken syntax))
  5. (define-syntax define-macro
  6. (er-macro-transformer
  7. (lambda (exp r c)
  8. (let ((def (cadr exp))
  9. (body (cddr exp)))
  10. `(define-syntax ,(car def)
  11. (er-macro-transformer
  12. (lambda (e2 r2 c2)
  13. (define (transform-func ,@(cdr def))
  14. ,@body)
  15. (apply transform-func (cdr e2))))))))))