'() vs () in Common Lisp

In Common Lisp, it seems to ()be self-esteem. That is, he evaluates himself (or his pseudonym nil). Therefore, there seems to be no need to quote it. But using grep in my quicklisp directory finds many instances '()written by many different people in many different projects. Is there a technical reason for writing a quoted version? Generic Lisp Lanugage, 2nd Edition , Section 1.2.2 , mentions stylistic differences in which you can highlight empty lists with ()and boolean false c nil, but does not cover this question. One example of the use of styles is:

(append '() '())

... which, I believe, can be written as well as:

(append () ())

... so why throw extra QUOTEsthere? Of course, this does not hurt. Stylistically, is one form usually preferable to the other? Someone, of course, could have made the cited form easier to add elements in case you change your mind and really want a non-empty list of literals instead. Or that there is some symmetry in using quotes, because he also needs a non-empty list of literals.

Does this historical baggage hang around other / older related languages ​​that have been continued by tradition?

This is not like the Scheme where you need to quote it. And it seems like you don’t need to specify it in elisp, so maybe in the circle it might be associated with lisp -1 vs. lisp -2?

+4
4

, , , . , .

() ( ), , , . nil, , .


:

1.4.1.4.4 NIL

nil . COMMON-LISP "NIL", ( ) false, , ( ).

Common Lisp, nil nil (). , , .

For Evaluation?  Notation  Typically Implied Role       
----------
Yes              nil       use as a boolean.            
Yes              'nil      use as a symbol.             
Yes              '()       use as an empty list         
No               nil       use as a symbol or boolean.  
No               ()        use as an empty list.        

1-1. NIL

nil false, .

:

(print ())                          ;avoided
(defun three nil 3)                 ;avoided 
'(nil nil)                          ;list of two symbols
'(() ())                            ;list of empty lists
(defun three () 3)                  ;Emphasize empty parameter list.
(append '() '()) =>  ()              ;Emphasize use of empty lists
(not nil) =>  true                   ;Emphasize use as Boolean false
(get 'nil 'color)                   ;Emphasize use as a symbol

, "" " ". , nil, true, , , , , . - , " false" " true" .

+6

'() (), () . , , , .

, '#(foo bar baz (+ 1 2)) #(foo bar baz (+ 1 2)). , , foo, bar, baz (+ 1 2) .

+4

Common Lisp () nil nil . , , , nil, , . , , .

CL, Lisp . CL, Scheme, LISP1, Lisp1 vs Lisp2, Scheme Lisp1 , , nil .

Scheme . , . , , booolean false true, nil t #t #f () , '().

, CL, , , . , , , .

+2

NIL, () T , , .

'() - , , , , , / Common Lisp ( , , ).

, CL - (), , Lisp Common Lisp, .

, , (), , - .

(defvar *options* '(debug))

...

(defvar *options* '())

, .

+2
source

All Articles