unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* append, push, and add-to-list.
@ 2021-07-04  3:18 Hongyi Zhao
  2021-07-04  4:35 ` Jean Louis
  2021-07-04 16:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 38+ messages in thread
From: Hongyi Zhao @ 2021-07-04  3:18 UTC (permalink / raw)
  To: help-gnu-emacs

I've noticed there are some similar functions, i.e., append, push, and
add-to-list, for revising/updating the content of a list. But I'm
still not so clear on the specific use scenarios for them. Consider
the following command [1]:

(push '(company-capf company-ispell) company-backends)

What's the equivalent representations using append and add-to-list?
Which methods are preferable?

[1] <https://github.com/company-mode/company-mode/issues/1124#issuecomment-864461337>

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



^ permalink raw reply	[flat|nested] 38+ messages in thread
* Re: append, push, and add-to-list.
@ 2021-07-05 14:37 Drew Adams
  2021-07-05 14:53 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 38+ messages in thread
From: Drew Adams @ 2021-07-05 14:37 UTC (permalink / raw)
  To: 'Help-Gnu-Emacs (help-gnu-emacs@gnu.org)'; +Cc: Emanuel Berg

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

> But with '() you see that it is (an empty) list:
> 
>   (defvar lst)
>   (setq lst '())

Yes, for human reading, () suggests that the
value might be used as a list, and nil suggests
that it might not be (e.g., it might be used as
a truth value or otherwise).

But there is no reason to quote ().  Like t,
() is evaluates to itself.

[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 12379 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2021-07-06 20:16 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-04  3:18 append, push, and add-to-list Hongyi Zhao
2021-07-04  4:35 ` Jean Louis
2021-07-04  5:11   ` Hongyi Zhao
2021-07-04 11:28     ` Jean Louis
2021-07-04 13:50       ` Hongyi Zhao
2021-07-04 15:58         ` Jean Louis
2021-07-05  2:04           ` Hongyi Zhao
2021-07-04 16:01         ` [External] : " Drew Adams
2021-07-04 16:20     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-04 16:19 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  2:16   ` Hongyi Zhao
2021-07-05  3:48     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  4:31       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  5:07         ` Hongyi Zhao
2021-07-05  5:50           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05  6:19             ` Hongyi Zhao
2021-07-05  5:06     ` Jean Louis
2021-07-05  6:22       ` Hongyi Zhao
2021-07-05  6:32         ` Emanuel Berg via Users list for the GNU Emacs text editor
  -- strict thread matches above, loose matches on Subject: below --
2021-07-05 14:37 Drew Adams
2021-07-05 14:53 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 15:19   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-05 16:46     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-06 19:54       ` Jean Louis
2021-07-06 20:08         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 15:41   ` tomas
2021-07-05 16:58     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 17:21       ` tomas
2021-07-06  1:17         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 18:10       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 18:18         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 18:11       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-05 18:39         ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-07-05 20:35           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-06 19:57         ` Jean Louis
2021-07-06 20:16           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-06 19:56       ` Jean Louis
2021-07-06 20:15         ` Emanuel Berg via Users list for the GNU Emacs text editor

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).