guile-devel
[Top][All Lists]
Advanced

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

Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and


From: Maxime Devos
Subject: Re: Fwd: [Patch] definitions in when, unless, do as well as in cond- and case-clauses
Date: Fri, 04 Feb 2022 20:58:00 +0000
User-agent: Evolution 3.38.3-1

Stefan Israelsson Tampe schreef op vr 04-02-2022 om 21:11 [+0100]:
> using an implicit let in conditionals are bad in that you cannot
> escape from the let form which means that you loos
> conditional defines for example in the toplevel. e.g. [...]

While old versions of Guile (Guile 1.8?) did support conditional
defines on the top-level, new versions of Guile (Guile 2.0 and later)
don't:

(if #true
    (define x 'foo)
    (define x 'bar))

While compiling expression:
Syntax error:
unknown file:2:4: definition in expression context, where definitions
are not allowed, in form (define x (quote foo))

The following still works though of course:

(define x (if #true 'foo 'bar))

So for the current version of Guile (3.0.X), there don't appear to be
backwards-compatibility problems in this area.

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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