Both
(not 'nil)
and
(not nil)
evaluate to T, so is there any difference between 'nil and nil? And what about ''nil? If ''nil evaluates to 'nil, shouldn’t ''nil evaluate to nil as well?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(quote <anything>)evaluates to<anything>, literally. The notation'<anything>means(quote <anything>), and regardless of what<anything>is, it is simply returned without being evaluated.Furthermore,
nilevaluates to itself.Other objects, when quoted as literals, also evaluate to themselves: certain symbols and all non-symbolic atoms are this way.
What is the difference between
'2and2? They both evaluate to2!Also, what is the difference between
'"abc"and"abc", and between:fooand':foo?The difference is that
'2is the form(quote 2)whereas2is just2. They evaluate to the same thing but aren’t the same thing.To evaluate Lisp means that a datum is treated as the source code of an expression. Two expressions can have the same value, yet be made of different data. For instance
4,(+ 2 2)and(* 2 2).Say, what’s the difference between
4and(+ 2 2)?If
4and(+ 2 2)both produce 4, why does'4produce4, but'(+ 2 2)produces(+ 2 2)?Quote means, “give me this piece of program code as a datum, rather than the value which it denotes.”