* bug#23417: 25.1.50; Elisp manual: document gotcha about new objects and quoting
@ 2016-05-01 21:09 Drew Adams
2019-07-28 15:04 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2016-05-01 21:09 UTC (permalink / raw)
To: 23417
In the Elisp manual, we do, in node `Rearrangement', point out the
gotcha that a quoted list sexp does not necessarily return a new list
(new cons) each time it occurs in code.
However:
1. The gotcha is more general than the nconc context where it is
presented. It is not limited to using a quoted constant list as a
non-last arg to nconc.
2. The gotcha is not limited to quoted constant lists. It applies
to #s also.
3. Please consider presenting the gotcha in general terms, somewhere.
And that place can then be cross-referenced from relevant nodes (e.g.
`Quoting' and `Creating Hash').
4. Please correct misleading text, such as this from `Creating Hash',
so as not to give the impression that you get a new object for each
occurrence of a quoted constant.
You can also create a new hash table using the printed
representation for hash tables.
Here is one example of confusion wrt the gotcha for #s:
http://stackoverflow.com/q/36964728/729907
In GNU Emacs 25.1.50.1 (i686-pc-mingw32)
of 2015-12-10
Repository revision: 6148555ee5a3d0139ae517803718b3e0357933c7
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=/c/Devel/emacs/snapshot/trunk --enable-checking=yes
--enable-check-lisp-object-type --without-compress-install 'CFLAGS=-Og
-ggdb3' LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
-Ic:/Devel/emacs/include''
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#23417: 25.1.50; Elisp manual: document gotcha about new objects and quoting
2016-05-01 21:09 bug#23417: 25.1.50; Elisp manual: document gotcha about new objects and quoting Drew Adams
@ 2019-07-28 15:04 ` Lars Ingebrigtsen
2021-02-07 13:48 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-28 15:04 UTC (permalink / raw)
To: Drew Adams; +Cc: 23417
Drew Adams <drew.adams@oracle.com> writes:
> In the Elisp manual, we do, in node `Rearrangement', point out the
> gotcha that a quoted list sexp does not necessarily return a new list
> (new cons) each time it occurs in code.
>
> However:
>
> 1. The gotcha is more general than the nconc context where it is
> presented. It is not limited to using a quoted constant list as a
> non-last arg to nconc.
>
> 2. The gotcha is not limited to quoted constant lists. It applies
> to #s also.
The test case is this:
(defun foo ()
#s(hash-table test eql))
(eq (foo) (foo))
=> t
> 3. Please consider presenting the gotcha in general terms, somewhere.
> And that place can then be cross-referenced from relevant nodes (e.g.
> `Quoting' and `Creating Hash').
I thought we already specified (somewhere in the manual) that a quoted
list often doesn't give us a new list, but after looking around for
seven seconds, I can't find it. What section would this info go in?
> 4. Please correct misleading text, such as this from `Creating Hash',
> so as not to give the impression that you get a new object for each
> occurrence of a quoted constant.
>
> You can also create a new hash table using the printed
> representation for hash tables.
>
> Here is one example of confusion wrt the gotcha for #s:
> http://stackoverflow.com/q/36964728/729907
Yes, that seems pretty misleading -- the natural interpretation of that
(and the example) is that you can use it exactly as is done in that code
snippet. Which you can't. Does anybody want to rephrase the "Creating
Hash" node in hash.texi?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#23417: 25.1.50; Elisp manual: document gotcha about new objects and quoting
2019-07-28 15:04 ` Lars Ingebrigtsen
@ 2021-02-07 13:48 ` Lars Ingebrigtsen
0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-07 13:48 UTC (permalink / raw)
To: Drew Adams; +Cc: 23417
Lars Ingebrigtsen <larsi@gnus.org> writes:
> I thought we already specified (somewhere in the manual) that a quoted
> list often doesn't give us a new list, but after looking around for
> seven seconds, I can't find it. What section would this info go in?
This is in Self-Evaluating Forms (now).
>> 4. Please correct misleading text, such as this from `Creating Hash',
>> so as not to give the impression that you get a new object for each
>> occurrence of a quoted constant.
>>
>> You can also create a new hash table using the printed
>> representation for hash tables.
>>
>> Here is one example of confusion wrt the gotcha for #s:
>> http://stackoverflow.com/q/36964728/729907
>
> Yes, that seems pretty misleading -- the natural interpretation of that
> (and the example) is that you can use it exactly as is done in that code
> snippet. Which you can't. Does anybody want to rephrase the "Creating
> Hash" node in hash.texi?
I've now clarified this in Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-07 13:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-01 21:09 bug#23417: 25.1.50; Elisp manual: document gotcha about new objects and quoting Drew Adams
2019-07-28 15:04 ` Lars Ingebrigtsen
2021-02-07 13:48 ` Lars Ingebrigtsen
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).