[Top][All Lists]

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

Re: syncase & co

From: Marius Vollmer
Subject: Re: syncase & co
Date: 25 Jun 2001 19:41:42 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Manuel Giraud <address@hidden> writes:

> I'm reading the Chez SchemeĀ¹ documentation that says this code :
> (let ((p (cons 0 #f)))
>   (define-syntax pcar
>     (lambda (x)
>       (syntax-case x ()
>         (_ (identifier? x) (syntax (car p)))
>         ((_ v) (syntax (set-car! p v))))))
>   (let ((a pcar))
>     (pcar 1)
>     (list a pcar)))
> should return : (0 1); while it gives (#<macro 42> #<macro 42>) using
> Guile.

Your example works when you do

    (use-syntax (ice-9 syncase))

instead of

    (use-modules (ice-9 syncase))

This is because the syntax-case expander needs to be specially
activated to have all of its effects.  `use-syntax' performs this
special activation, while `use-modules' does not.

reply via email to

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