[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cond clause does not allow definitions
From: |
Linus Björnstam |
Subject: |
Re: cond clause does not allow definitions |
Date: |
Fri, 24 May 2024 16:27:51 +0200 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-480-g515a2f54a-fm-20240515.001-g515a2f54 |
I submitted a patch that expanded definition context to more places (cond,
case, when, unless etc). I dont know what happened to that. I submitted it
while moving and promptly forgot about it after some discussion.
-- Linus Björnstam
On Wed, 22 May 2024, at 21: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)
>
> but it is allowed in else clause:
> scheme@(guile-user)> (cond (else (define x 7) x))
> $4 = 7
>
> not really logic
>
> it is allowed in Kawa and Racket but they are not scheme references
> the R5RS and R7RS talk about 'clause' without more information
>
> is it normal for Guile to consider clause for cond to be an expression
> context and not a definition context?
>
> should not be better to consider definition context? that would allow more
> possibilities.
- Re: cond clause does not allow definitions, (continued)
Re: cond clause does not allow definitions, Pierpaolo Bernardi, 2024/05/22
RE: cond clause does not allow definitions, Maxime Devos, 2024/05/22
Re: cond clause does not allow definitions,
Linus Björnstam <=