[Top][All Lists]

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

Re: problems evaluating code depending on version

From: Andy Wingo
Subject: Re: problems evaluating code depending on version
Date: Thu, 17 May 2012 10:20:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

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]