[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isn't computation-rules redundant?



At Tue, 23 Mar 2004 09:44:26 -0800 (PST), campbell@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:
> 
> On Tue, 23 Mar 2004, Alex Shinn wrote:
> > 
> > Am I missing something?
> 
> Yes.  DEFINE-SYNTAX is supposed to be the _universal_ derived syntax
> definition form. DEFINE-SYNTAX-COMPUTATION should be the noise word;
> you should be able to do things like:
> 
>   (define-syntax foo (syntax-rules () ...))
>   (define-syntax bar
>     (explicit-renaming (lambda (form rename compare) ...)))
>   (define-syntax baz
>     (syntax-computations () ;or computation-rules, or whatever
>       ...))
>   (define-syntax quux
>     (syntactic-closures (lambda (form creation-env usage-env) ...)))
>
> The fact that you currently cannot extend the set of transformer forms
> for the right-hand-sides of syntax definitions is due to entirely
> separate issues regarding module systems, environment towers, and other
> matters.  If R6RS defines a Scheme48-style module system, as has been
> suggested at the 2003 Scheme Workshop, you'll certainly be able to
> easily extend that set without saying 'this set is extended by this
> SRFI but I sha'n't tell you how,' as is necessary currently.

But in this case DEFINE-SYNTAX-COMPUTATION is not a noise word but
itself syntactic sugar:

  (define-syntax define-syntax-computation
    (syntax-rules ()
      ((define-syntax-computation name vars rules)
       (define-syntax name
         (syntax-computations vars rules)))))

Since we need to define define-syntax-computation separately in this
SRFI for portability, why not make it the more readable version?

-- 
Alex