* bug#64537: mix lists and vectors when using backquote
@ 2023-07-09 5:40 Shynur Xie
2023-09-22 9:08 ` Stefan Kangas
0 siblings, 1 reply; 4+ messages in thread
From: Shynur Xie @ 2023-07-09 5:40 UTC (permalink / raw)
To: 64537
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#64537: mix lists and vectors when using backquote
2023-07-09 5:40 bug#64537: mix lists and vectors when using backquote Shynur Xie
@ 2023-09-22 9:08 ` Stefan Kangas
2023-09-22 15:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2023-09-22 9:08 UTC (permalink / raw)
To: Shynur Xie; +Cc: 64537, Stefan Monnier
Shynur Xie <one.last.kiss@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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#64537: mix lists and vectors when using backquote
2023-09-22 9:08 ` Stefan Kangas
@ 2023-09-22 15:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 9:47 ` Stefan Kangas
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-22 15:03 UTC (permalink / raw)
To: Stefan Kangas; +Cc: 64537, Shynur Xie
>> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#64537: mix lists and vectors when using backquote
2023-09-22 15:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-24 9:47 ` Stefan Kangas
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2023-09-24 9:47 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 64537, Shynur Xie
Stefan Monnier <monnier@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?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-24 9:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 5:40 bug#64537: mix lists and vectors when using backquote Shynur Xie
2023-09-22 9:08 ` Stefan Kangas
2023-09-22 15:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 9:47 ` Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).