GNU bug report logs -
#48318
(ice-9 match) does not allow distinguishing between () and #nil
Previous Next
Full log
View this message in rfc822 format
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
This bug report was last modified 4 years and 32 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.