I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today:
> \'1
1
> (+ \'1 \'1)
2
> (+ \'1 1)
2
>
In Lisp, quote
prevent the following expression to be evaluated. '
is a shorthand for quote
. As a result, '1
is same as (quote 1)
.
However, in Lisp, symbols can never be a number. I mean, 'abc
is a symbol, but '123
is not (evaluated into) a symbol. I think this is wrong of the design of Lisp. Another case is not only #t
or #f
can be used as a Boolean expression.