GNU bug report logs -
#64537
mix lists and vectors when using backquote
Previous Next
To reply to this bug, email your comments to 64537 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64537
; Package
emacs
.
(Sun, 09 Jul 2023 05:46:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Shynur Xie <one.last.kiss <at> outlook.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 09 Jul 2023 05:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The docstring of ‘backquote’ says “vectors work just like lists”.
Should we also clarify that mixing lists and vectors these 2 way:
`(... ,@[...]) ; by contrast: `(,@[] 1) => (1)
`[,@'()] ; by contrast: `[1 ,@'()] => [1]
will lead to unexpected behavior? Or suggest not doing so? Or let
‘backquote’ detect this and signal an error?
BTW, if [[https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64415]] is
actually not a bug, please consider document that behavior. Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64537
; Package
emacs
.
(Fri, 22 Sep 2023 09:09:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 64537 <at> debbugs.gnu.org (full text, mbox):
Shynur Xie <one.last.kiss <at> outlook.com> writes:
> The docstring of ‘backquote’ says “vectors work just like lists”.
> Should we also clarify that mixing lists and vectors these 2 way:
>
> `(... ,@[...]) ; by contrast: `(,@[] 1) => (1)
> `[,@'()] ; by contrast: `[1 ,@'()] => [1]
>
> will lead to unexpected behavior? Or suggest not doing so? Or let
> ‘backquote’ detect this and signal an error?
Copying in Stefan Monnier.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64537
; Package
emacs
.
(Fri, 22 Sep 2023 15:06:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 64537 <at> debbugs.gnu.org (full text, mbox):
>> The docstring of ‘backquote’ says “vectors work just like lists”.
>> Should we also clarify that mixing lists and vectors these 2 way:
>>
>> `(... ,@[...]) ; by contrast: `(,@[] 1) => (1)
>> `[,@'()] ; by contrast: `[1 ,@'()] => [1]
>>
>> will lead to unexpected behavior? Or suggest not doing so? Or let
>> ‘backquote’ detect this and signal an error?
>
> Copying in Stefan Monnier.
Is there a good reason why we have those unexpected behaviors?
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64537
; Package
emacs
.
(Sun, 24 Sep 2023 09:48:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 64537 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>>> The docstring of ‘backquote’ says “vectors work just like lists”.
>>> Should we also clarify that mixing lists and vectors these 2 way:
>>>
>>> `(... ,@[...]) ; by contrast: `(,@[] 1) => (1)
>>> `[,@'()] ; by contrast: `[1 ,@'()] => [1]
>>>
>>> will lead to unexpected behavior? Or suggest not doing so? Or let
>>> ‘backquote’ detect this and signal an error?
>>
>> Copying in Stefan Monnier.
>
> Is there a good reason why we have those unexpected behaviors?
I see two unexpected behaviors:
1. `(... ,@[...]) => (\... . [\...])
2. `[,@'()] => [(\,@ 'nil)]
I'd say these are the expected values:
1. `(... ,@[...]) => (\... \...)
2. `[,@'()] => []
I don't see any good reason for them, so perhaps these are just plain
bugs to be fixed?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64537
; Package
emacs
.
(Sat, 08 Jun 2024 23:56:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 64537 <at> debbugs.gnu.org (full text, mbox):
> `(... ,@[...]) ; by contrast: `(,@[] 1) => (1)
AFAICT this is the result of an optimization:
`(BAR ,@FOO)
is optimized to
`(BAR . ,FOO)
I expect a fair bit of code "relies" on this optimization, so I'm not
sure we want to "fix" it.
> `[,@'()] ; by contrast: `[1 ,@'()] => [1]
This looks like a plain bug (probably linked to another optimization).
`[,@(not t)]
doesn't suffer from this problem but
`[,@'[]]
also suffers from it.
Stefan
This bug report was last modified 1 year and 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.