chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] match-let and hygiene incompatible?


From: felix winkelmann
Subject: Re: [Chicken-users] match-let and hygiene incompatible?
Date: Fri, 20 May 2005 07:55:01 +0200

On 5/20/05, Greg Buchholz <address@hidden> wrote:
> 
>     Are hygienic macros incompatible with the pattern matching as
> described in...
> 
> http://www.call-with-current-continuation.org/manual/Unit-match.html
> 
> ...When I use the "-hygienic" option, I get an error like...
> 
>     Error: unbound variable: a
> 
> ...for this piece of code...
> 
>     (display (match-let (((a b c) (list 1 2 3)))
>                 (+ a b c)))
> 
> ...Which works perfectly with no hygiene option specified.
> 

As Michele already remarked, in hygienic mode, the match macros
have to be explicitly loaded (since in this mode macros are slurped
in in source form and are not predefined there is some overhead
in loading them - for this reason they are not available by default).
I usually recommend

(require-extension match)

instead of `(require 'match)', though.

Since the match stuff (taken more more less directly from Andrew
Wrights original implementation) is defined in terms of lowlevel
macros, there can be some subtle hygienic-related problems.
Especially with (hygienic) macros that expand into uses of
`match'). So mixing hygenic/syntax-case macros with match
will work mostly, but has to be done with care.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]