Changed the @ (slot-value composition macro) not to do the dollar sign
authorVladimir Sedach <vsedach@gmail.com>
Mon, 2 Feb 2009 20:27:00 +0000 (13:27 -0700)
committerVladimir Sedach <vsedach@gmail.com>
Mon, 2 Feb 2009 20:27:00 +0000 (13:27 -0700)
thing if the first argument is a string ('$' is a Prototype library
function), and not to do spurious macroexpansion.

src/lib/ps-macro-lib.lisp

index dc53065..da74bdc 100644 (file)
 
 (defpsmacro @ (obj &rest props)
   "Handy slot-value/aref composition macro."
-  (if (null props)
-      obj
-      `(@ (slot-value
-           ,(if (stringp obj) `($ ,obj) obj)
-           ,(let ((prop (macroexpand (first props))))
-                 (if (symbolp prop)
-                     `',prop
-                     prop)))
-        ,@(cdr props))))
+  (if props
+      `(@ (slot-value ,obj ,(if (symbolp (car props)) `',(car props) (car props))) ,@(cdr props))
+      obj))
 
 (defpsmacro concatenate (result-type &rest sequences)
   (assert (equal result-type ''string) () "Right now Parenscript 'concatenate' only support strings.")