Steven M. Haflich <smh_no_spiced_ham@alum.mit.edu> wrote:
+---------------
| cl:quote doesn't need to be a special operator, either.
| It could have been a macro:
|
| (defmacro quote (object)
| (list 'svref (vector object) 0))
+---------------
Uh... Got a little problem with bootstrapping there. How do you
get that 'SVREF in there in the first place without turtling
all the way down? ;-}
Just kidding. That can be fixed up easily enough:
(defmacro quote (object)
(list (load-time-value (intern "SVREF" "COMMON-LISP"))
(vector object)
0))
Here's another way to do it which probably executes faster but
may (or may not) consume more space:
(defmacro quote (object)
(let ((symbol (gensym)))
(setf (symbol-value symbol) object)
symbol))
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607