Subject: Re: Why no BACKQUOTE special operator?
From: rpw3@rpw3.org (Rob Warnock)
Date: Mon, 13 Oct 2003 02:03:48 -0500
Newsgroups: comp.lang.lisp
Message-ID: <JN-dnbmeQ__J0xeiXTWc-w@speakeasy.net>
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