Re: [Scheme-reports] [wg2] in support of single-arity procedural syntax transformers Alex Shinn (11 May 2011 11:02 UTC)

Re: [Scheme-reports] [wg2] in support of single-arity procedural syntax transformers Alex Shinn 11 May 2011 11:01 UTC

I would like to argue in favor of triple-arity, single-return syntax
transformers.

That is to say, the following should be a valid, though non-terminating,
program:

  (define-syntax id
    (lambda (x use-env mac-env)
      x))

As should this:

  (define-syntax else
    (lambda (x use-env mac-env)
      (error "else referenced in invalid context")))

Triple-arity is the right answer for implementers that want to
experiment with different macro systems, because it presents a uniform,
extensible macro transformer interface -- you have full information
of the expression, its usage environment, and the environment the
macro was originally defined in.

It also happens to be the underlying implementation used in
most ER macro systems, and WG2 has already voted to
provide ER macros.

--
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports