After playing with vectors and complex numbers in Common Lisp, I became curious about something. Namely, how does the quote
operator relate to these data structures?
For instance, when it comes to lists, the following examples are straightforward to me:
CL-USER> '(1 2)
(1 2)
CL-USER> ''(1 2)
'(1 2)
Let's do the same with vectors:
CL-USER> #(1 2)
#(1 2)
CL-USER> '#(1 2)
#(1 2)
CL-USER> ''#(1 2)
'#(1 2)
And complex numbers:
CL-USER> #c (1 2)
#C(1 2)
CL-USER> '#c (1 2)
#C(1 2)
CL-USER> ''#c (1 2)
'#C(1 2)
To save space, I will just say that quoting characters behaves similarly.
My question is why is it that the #
and '#
evaluated to the same expression? What is the reason for that? What are the "guts" of this mechanism?