[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: append, push, and add-to-list.
From: |
Drew Adams |
Subject: |
RE: [External] : Re: append, push, and add-to-list. |
Date: |
Mon, 5 Jul 2021 16:19:01 +0000 |
> An unquoted list would be, for example, (list 1 2 3) So to
> keep it consistent, without a quote, would it be
> (defvar lst)
> (setq lst (list)) ; nil
> ?
If you really want, yes you can write `(list)'.
That evaluates to nil just like nil, '(), and () do.
`list' is a function. `(list ...)' is a function call.
() is not a function call. It's a constant.
It's just alternative _syntax_ for nil.
'() is syntax for the special form `(quote ())'.
All of `(list)', (), '(), and nil evaluate to nil.
> '() makes it easier to spot immediately, hey,
> that's an empty list.
To each their own. ;-) I don't find '() easier
to spot than ().
> But ... ultimately one writes code so the computer can execute
> it, and not so that a human can read it. So maybe one
> shouldn't quote empty lists?
>
> If so, I have 14 corrections to make...
No, the computer couldn't care less whether
you write (list), nil, (), or '(). ;-)
<<attachment: winmail.dat>>
- Re: Quote by Knuth, (continued)
- Re: Quote by Knuth, Eli Zaretskii, 2021/07/15
- Re: Quote by Knuth, Emanuel Berg, 2021/07/18
- Re: Quote by Knuth, tomas, 2021/07/19
- Quote by Knuth, Christopher Dimech, 2021/07/19
- Re: Quote by Knuth, Emanuel Berg, 2021/07/21
- Quote by Knuth, Christopher Dimech, 2021/07/21
- Re: Quote by Knuth, Emanuel Berg, 2021/07/21
- Re: Quote by Knuth, Gregory Heytings, 2021/07/21
- Quote by Knuth, lisa-asket, 2021/07/19
- Quote by Knuth, Christopher Dimech, 2021/07/06
- RE: [External] : Re: append, push, and add-to-list.,
Drew Adams <=
- Re: [External] : Re: append, push, and add-to-list., Emanuel Berg, 2021/07/05