[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cond clause does not allow definitions
From: |
lloda |
Subject: |
Re: cond clause does not allow definitions |
Date: |
Wed, 22 May 2024 22:40:12 +0200 |
Fwiw Guile isn't 100% consistent about this, for example match forms don't
allow definitions and maybe some other form that I don't recall atm.
> On 22 May 2024, at 22:37, lloda <lloda@sarc.name> wrote:
>
>
> This is probably
> http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=764e3614b8c13de604399572a67d071621e9ca21
>
> <http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=764e3614b8c13de604399572a67d071621e9ca21>
> and the next commit that documents the change. It was after 3.0.9.
>
>> On 22 May 2024, at 22:33, Damien Mattei <damien.mattei@gmail.com
>> <mailto:damien.mattei@gmail.com>> wrote:
>>
>> Bonjour,
>>
>> so it is with the version i currently use which is older than you:
>> (base) mattei@mbp-touch-bar library-FunctProg % guile
>> GNU Guile 3.0.8.99-f3ea8
>> Copyright (C) 1995-2022 Free Software Foundation, Inc.
>>
>> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
>> This program is free software, and you are welcome to redistribute it
>> under certain conditions; type `,show c' for details.
>>
>> Enter `,help' for help.
>> scheme@(guile-user)> (cond (#t (define x 7) x))
>> While compiling expression:
>> Syntax error:
>> unknown file:1:10: definition in expression context, where definitions are
>> not allowed, in form (define x 7)
>>
>> thanks
>>
>> On Wed, May 22, 2024 at 10:07 PM Jeronimo Pellegrini <j_p@aleph0.info
>> <mailto:j_p@aleph0.info>>
>> wrote:
>>
>>> Hello!
>>>
>>> On 2024-05-22 16:26, Damien Mattei wrote:
>>>> scheme@(guile-user)> (cond (#t (define x 7) x))
>>>> While compiling expression:
>>>> Syntax error:
>>>> unknown file:7:10: definition in expression context, where definitions
>>>> are
>>>> not allowed, in form (define x 7)
>>>
>>> I get no error here (Guile 3.0.9.164-e1690, compiled locally):
>>>
>>> scheme@(guile-user)> (cond (else (define x 7) x))
>>> $1 = 7
>>> scheme@(guile-user)> (cond (#t (define x 7) x))
>>> $2 = 7
>>>
>>> A: (cond (#t (define x 7) x))
>>> B: (cond (else (define x 7) x))
>>>
>>> | system | A | B |
>>> |-------------|-------|-------|
>>> | Bigloo | 7 | 7 |
>>> | Biwa | 7 | 7 |
>>> | Chez | error | 7 |
>>> | Chibi | error | 7 |
>>> | Chicken | 7 | 7 |
>>> | Cyclone | 7 | 7 |
>>> | Gambit | error | error |
>>> | Gauche | 7 | 7 |
>>> | Guile | 7 | 7 |
>>> | Kawa | 7 | 7 |
>>> | LIPS | 7 | error |
>>> | Loko | error | error |
>>> | MIT | error | 7 |
>>> | Racket | 7 | 7 |
>>> | Sagittarius | 7 | 7 |
>>> | Scheme48 | error | 7 |
>>> | Scheme 9 | error | 7 |
>>> | SCM | 7 | 7 |
>>> | STklos | 7 | 7 |
>>> | Tinyscheme | 7 | 7 |
>>>
>>> * LIPS does not recognise the 'else' clause.
>>>
>>> J.
>>>
>
RE: cond clause does not allow definitions, Maxime Devos, 2024/05/22
Re: cond clause does not allow definitions, Linus Björnstam, 2024/05/24