bug-guile
[Top][All Lists]
Advanced

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

Re: export in syntax-rules


From: Mikael Djurfeldt
Subject: Re: export in syntax-rules
Date: Mon, 27 Jan 2003 12:23:16 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

Kevin Ryde <address@hidden> writes:

> In guile 1.6.1 on a recent i386 debian, I thought to use "export"
> inside a syntax-rules in a module definition, for instance
>
>     (define-module (abc def)
>       #:use-module (ice-9 syncase))

You might want to use #:use-syntax (ice-9 syncase) here instead,
otherwise syntax-case expansion is only invoked when syntax-case
macros are called in an s-expression.  That disables singleton macros
and can cause unexpected errors with regard to scope.

>     (define-syntax foo
>       (syntax-rules ()
>         ((foo name)
>          (export name))))
>
>     (define x 123)
>     (foo x)
>
> But I got an error,
>
>     ERROR: In procedure variable-ref:
>     ERROR: Wrong type argument in position 1 (expecting variable): #f
>
> Is this sort of thing meant to work, or have I made some basic error?
>
> (I was looking to make "-public" versions of some macros.  I got the
> effect I wanted with a procedure->macro, but just wondered if the
> syntax-rules style was valid.)

This is caused by a bug in syncase.scm.  I've fixed this in CVS 1.7.0
and in the 1.6 branch.  1.6.2 will contain the fix.

2003-01-27  Mikael Djurfeldt  <address@hidden>

        * syncase.scm (guile-macro): Strip syntactic information from
        expression before trying to treat it as a Guile macro call.
        (Thanks to Kevin Ryde.)




reply via email to

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