On 5/20/05, Greg Buchholz <[EMAIL PROTECTED]> 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


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to