guile-user
[Top][All Lists]
Advanced

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

Re: cond clause does not allow definitions


From: Pierpaolo Bernardi
Subject: Re: cond clause does not allow definitions
Date: Thu, 23 May 2024 16:59:05 +0200

On Thu, May 23, 2024 at 4:25 PM Damien Mattei <damien.mattei@gmail.com> wrote:
> On Thu, May 23, 2024 at 12:37 AM Jeronimo Pellegrini <j_p@aleph0.info> wrote:
>> On 2024-05-22 18:07, Pierpaolo Bernardi wrote:
>> > In chez:
>> >
>> >> (cond (else (define x 7) x))
>> > 7
>> >> x
>> > 7
>> >
>> > which looks like a bug to me.

> yes i spent many hours debugging to understand why
> (cond (else (define y 7) y)) worked and not (cond (#t (define x 7) x))

I had and explanation from Jamie Taylor.

The implementations which behave like Chez, are probably using the
example definition of the cond syntax given in appendix B of the R6
report, which expands (cond (else result1 result2 ...)) into (begin
result1 result2 ...). Given the splicing nature of begin, when the
cond is in a context valid for definitions we have the weird result
above.

https://github.com/cisco/ChezScheme/issues/835



reply via email to

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