2/23/2008

Define-macro with several forms

Gauche, one of the most powerful scheme R5RS implementations, has define-macro special form. It's useful but can take only one procedure as the defining form. So I use values special form to set several forms in one define-macro. For exapmle,
(define-macro foo
  (values 
    '(define ...)
    '(main form ...))

I wonder this technique is appropriate.

I've misunderstood. I'd do like this.
(define-macro foo
  `(begin
    (define ...)
    (main form ...))

0 Comments:

Post a Comment

<< Home