[Top][All Lists]

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

Re: problems evaluating code depending on version

From: Stefan Israelsson Tampe
Subject: Re: problems evaluating code depending on version
Date: Thu, 17 May 2012 14:47:09 +0200

I tried cond-expand, just to see if it worked and no
the export clause does not fall through and the symbols are not exported.

I can fix this as you say by using the new interface syntax-parameter interface
but I'm curious how to be ably to conditionally export symbols depending on the


On Thu, May 17, 2012 at 10:20 AM, Andy Wingo <address@hidden> wrote:
On Wed 16 May 2012 23:32, Stefan Israelsson Tampe <address@hidden> writes:

> (define-syntax guile-stuff
>   (lambda (x)
>     (syntax-case x ()
>       (_
>        (let ((q (ver)))
>          (cond
>           ((eq? q 'v2.0)
>            #'(begin 1))
>           ((eq? q 'v2.1)
>            #'(begin
>                (define-syntax-rule (fluid-let-syntax . l)
>                  (syntax-parametrize . l))
>                (export fluid-let-syntax)))
>           (else (error "not supported version"))))))))

Here the macro introduces a new identifier, fluid-let-syntax.  But its
context is not that of the (guile-stuff) _expression_.  If you did
(datum->syntax 'fluid-let-syntax x) that might work.

In general cond-expand is better.  I just added a guile-2.2 feature on
master.  Use that instead.

But in this case, better to just change both versions to use
syntax-parameterize :)


reply via email to

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