What should 3 rate? It makes the most sense that Lisp evaluates the number for itself. Do we want the numbers indicated in the code? This would not be very convenient and extremely problematic:
Instead
(defun add-fourtytwo (n) (+ n 42))
we would have to write
(defun add-fourtytwo (n) (+ n '42))
Each number in the code must be indicated. A missing quote will cause an error. This is not what I would like to use.
As an additional note, imagine what happens if you want to use eval in your code.
(defun example () (eval 3))
The above would be wrong. Numbers must be indicated.
(defun example () (eval '3))
The above would be nice, but generate a runtime error. Lisp evaluates '3 to number 3. But then calling eval to a number will be an error, as they must be specified.
So, we will need to write:
(defun example () (eval ''3))
This is not very useful ...
Numbers are always self-esteeming in Lisp history. But in earlier Lisp implementations, some other data objects, such as arrays, did not have self-esteem. Again, since this is a huge source of errors, Lisp dialogs such as Common Lisp have determined that all data types (except lists and characters) are self-evaluating.
Rainer joswig
source share