unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Taylan Kammer <taylan.kammer@gmail.com>
To: 48318@debbugs.gnu.org
Cc: Maxime Devos <maximedevos@telenet.be>
Subject: bug#48318: (ice-9 match) does not allow distinguishing between () and #nil
Date: Thu, 13 May 2021 21:14:26 +0200	[thread overview]
Message-ID: <d68fdbea-533d-2444-9fde-85775d3bf8de@gmail.com> (raw)
In-Reply-To: <4c8839f49a6c7317324d5360d74594c181b0588b.camel@telenet.be>

Hi Maxime,

I believe that match conflating () and #nil is the right thing,
even if the current implementation does it unintentionally.

Those two values should be considered "the same" in most situations
even though (eqv? #nil '()) is false.

In fact I think they should be equal? to each other.  It feels
wrong that (equal? '(foo . #nil) '(foo . ())) evaluates to false,
even though both arguments represent the list '(foo).

Please note that #nil is not ever supposed to be used intentionally.
It's there purely as an Elisp compatibility trick, and the only time
Scheme could should receive it is when receiving data generated by
Elisp code.  For instance when Elisp code generates a list, it would
be terminated by #nil.  (Which is why I think it should equal? '().)

Does that make sense to you?  I'm not sure what the Guile maintainers
would say about (equal? #nil '()).


- Taylan





  reply	other threads:[~2021-05-13 19:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 16:42 bug#48318: (ice-9 match) does not allow distinguishing between () and #nil Maxime Devos
2021-05-13 19:14 ` Taylan Kammer [this message]
2021-05-13 20:39   ` Maxime Devos
2021-05-13 21:21     ` Taylan Kammer

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=d68fdbea-533d-2444-9fde-85775d3bf8de@gmail.com \
    --to=taylan.kammer@gmail.com \
    --cc=48318@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /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).