[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
with* in the latest release
- To: commonloops.pa@Xerox.COM
- Subject: with* in the latest release
- From: ehl%cogsci.Berkeley.EDU@berkeley.edu (Edward H. Lay)
- Date: Sun, 8 Feb 87 14:27:15 PST
walking macrolets inside of with* seems to be broken in the latest release
running in lucid 1.2. An example follows:
;; COLLECT is straight from the book, and is documented there.
(DEFMACRO WITH-COLLECTION (&BODY BODY)
(LET ((VAR (GENSYM)))
`(LET ((,VAR NIL))
(MACROLET ((COLLECT (ARGUMENT)
`(PUSH ,ARGUMENT ,',VAR)))
. ,BODY)
(NREVERSE ,VAR))))
;; and to catch unbounded COLLECTs
(DEFMACRO COLLECT (ARGUMENT)
(WARN "~S Used Outside of ~S" 'COLLECT 'WITH-COLLECTION)
`(ERROR "~S Used Outside of ~S" `(COLLECT ,,ARGUMENT) 'WITH-COLLECTION))
(defclass foo () ((a 1)))
;; this works
(defmeth test1 ((foo foo) list)
(with-collection
(dolist (e list) (collect (+ e (get-slot foo 'a))))))
;; this doesn't
(defmeth test2 ((foo foo) list)
(with* (foo)
(dolist (e list) (collect (+ e a)))))
edward lay