[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

with* in the latest release



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