Re: isn't computation-rules redundant?
campbell@xxxxxx 26 Mar 2004 23:20 UTC
On Fri, 26 Mar 2004, Andre van Tonder wrote:
> One rationale for the current decoupling of the defining form from the
> transformer (as in syntax-rules) is that
> one has a uniform way of denoting a transformer, whether it is bound to a
> name using define-syntax, bound using let(rec)-syntax, or used
> anonymously. Your proposal, while more brief, conflates declaring the
> transformer and binding it, and only in define forms but not
> let(rec)-forms - in the latter you still have to write it out the long
> way.
>
> I have another idea: instead of using define-syntax, introduce a
> form DEFINE-TRANSFORMER which will handle both syntax-rules and
> syntax-computations, and which can be portable extended to handle other
> kinds of tranformers should the need arise in future. So one would write
>
> (define-transformer name
> (syntax-rules (...) ...))
>
> (define-transformer name
> (syntax-computations (...) ...))
>
> (define-transformer name
> (lambda (stx) (syntax-case stx (...) ...)
>
> and so on. The same goes for LET-TRANSFORMER and LETREC-TRANSFORMER.
Huh? This is the what DEFINE-SYNTAX _already_is_! I don't care if a
couple implementations hardwire SYNTAX-RULES into DEFINE-SYNTAX; that
can easily be fixed, just as easily as introducing a new definition
form for macros. What you propose here is _exactly_ what I _already_
suggested, except that I used the existing DEFINE-SYNTAX.