[R6RS] syntax-case

Manuel Serrano Manuel.Serrano
Mon Oct 18 04:59:16 EDT 2004


> I agree in principle and would be happy to work with you on this,
> but there are some fundamental differences between syntax-case and
I'd be glad too. I have to finish my work on the modules firt :-)

> > I agree in principle and would be happy to work with you on this,
> > but there are some fundamental differences between syntax-case and
> > general-purpose matchers like match-case that might prevent their
> > unification.
> 
> Can you elaborate on this.  I'm not sure what you are refering to.
I share this with Marc.

> >   If we can't make them 100% the same, perhaps we can still
> > make them compatible in some sense so that programmers familiar with one
> > can easily use the other and so that implementations can use a common
> > underlying implementation.
> 
> I agree that this would be good.
> 
> Pattern-matching and the record system should work well together, so that
> this could be done:
> 
>   (define-type add x y)
> 
>   (define (simplify expr)
>     (match expr ()
>       ((add 0 a) a)
>       ((add a 0) a)
>       ((add a b) (and (number? a) (number? b)) (+ a b))
>       (else      expr)))
You can have a look at the Bigloo documentation. It supports 
exactly this.

-- 
Manuel


More information about the R6RS mailing list