unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Jeronimo Pellegrini <j_p@aleph0.info>
To: Pierpaolo Bernardi <olopierpa@gmail.com>
Cc: Damien Mattei <damien.mattei@gmail.com>, guile-user <guile-user@gnu.org>
Subject: Re: cond clause does not allow definitions
Date: Wed, 22 May 2024 19:37:02 -0300	[thread overview]
Message-ID: <9ff8d2d644823f62e416047582433d2b@aleph0.info> (raw)
In-Reply-To: <CANY8u7E3gTQpdwBh-XZq9YUQMg5aufNr1XxZPrE8Abz0VbNRWg@mail.gmail.com>

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. You may check if x is defined outside of
> the cond expression in the other implementations which do not raise an
> error too?

Sure! And the result varies a lot!

(cond (#t (define x 7) x))
(cond (else (define y 7) y))

| System      | A     | x     | B         | y         |
|-------------|-------|-------|-----------|-----------|
| Bigloo      | 7     | x     | 7         | 7         |
| Biwa        | 7     | 7     | 7         | 7         |
| Chez        | error | error | 7         | 7         |
| Chibi       | error | error | 7         | 7         |
| Chicken     | 7     | 7     | 7         | 7         |
| Cyclone     | 7     | error | 7         | error     |
| Gambit      | error | error | error     | error     |
| Gauche      | 7     | 7     | 7         | 7         |
| Guile       | 7     | error | 7         | error     |
| Kawa        | 7     | error | 7         | 7         |
| LIPS        | 7     | error | error (*) | error (*) |
| Loko        | error | error | error     | error     |
| MIT         | error | error | error     | error     |
| Racket      | 7     | error | 7         | error     |
| Sagittarius | 7     | 7     | 7         | 7         |
| Scheme48    | error | error | 7         | 7         |
| Scheme 9    | error | error | 7         | 7         |
| SCM         | 7     | 7     | 7         | 7         |
| STklos      | 7     | 7     | 7         | 7         |
| Tinyscheme  | 7     | 7     | 7         | 7         |

* LIPS does not recognise the `else` clause when it's the only 
expression in `cond`.

J.



  parent reply	other threads:[~2024-05-22 22:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22 19:26 cond clause does not allow definitions Damien Mattei
2024-05-22 20:07 ` Jeronimo Pellegrini
2024-05-22 20:33   ` Damien Mattei
2024-05-22 20:34     ` Damien Mattei
2024-05-22 20:37     ` lloda
2024-05-22 20:40       ` lloda
2024-05-22 21:07   ` Pierpaolo Bernardi
2024-05-22 22:09     ` Damien Mattei
2024-05-22 22:37     ` Jeronimo Pellegrini [this message]
2024-05-23 14:25       ` Damien Mattei
2024-05-23 14:59         ` Pierpaolo Bernardi
2024-05-22 22:12 ` Maxime Devos
2024-05-22 22:34   ` Damien Mattei
2024-05-24 14:27 ` Linus Björnstam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ff8d2d644823f62e416047582433d2b@aleph0.info \
    --to=j_p@aleph0.info \
    --cc=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=olopierpa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).