Tutorial by Examples

Quote is a special operator that prevents evaluation of its argument. It returns its argument, unevaluated. CL-USER> (quote a) A CL-USER> (let ((a 3)) (quote a)) A
The notation 'thing is equal to (quote thing). The reader will do the expansion: > (read-from-string "'a") (QUOTE A) Quoting is used to prevent further evaluation. The quoted object evaluates to itself. > 'a A > (eval '+ 1 2) 3
Avoid destructive operations on quoted objects. Quoted objects are literal objects. They are possibly embedded in the code in some way. How this works and the effects of modifications are unspecified in the Common Lisp standard, but it can have unwanted consequences like modifying shared data, tryin...
Note that many datatypes don't need to be quoted, since they evaluate to themselves. QUOTE is especially useful for symbols and lists, to prevent evaluation as Lisp forms. Example for other datatypes not needed to be quoted to prevent evaluation: strings, numbers, characters, CLOS objects, ... Her...

Page 1 of 1