[cl-enumeration-cvs] CVS enumerations
CVS User mantoniotti
mantoniotti at common-lisp.net
Fri Sep 30 14:18:01 UTC 2011
Update of /project/cl-enumeration/cvsroot/enumerations
In directory tiger.common-lisp.net:/tmp/cvs-serv7621
Modified Files:
iterate-enumeration.lisp
Log Message:
Added patch by Mason Smith to avoid calling ENUM:ENUMERATE in the
ITERATE OVER drive.
--- /project/cl-enumeration/cvsroot/enumerations/iterate-enumeration.lisp 2010/12/30 13:25:38 1.2
+++ /project/cl-enumeration/cvsroot/enumerations/iterate-enumeration.lisp 2011/09/30 14:18:01 1.3
@@ -11,10 +11,15 @@
(defmacro-driver (FOR var OVER enum)
(let ((e (gensym "ENUM-"))
+ (et (gensym "ENUM-"))
(kwd (if generate 'generate 'for))
)
`(progn
(with ,e = ,enum)
+ (with ,e = (let ((,et ,enum))
+ (if (enum:enumerationp ,et)
+ ,et
+ (enum:enumerate ,et))))
(,kwd ,var next (if (enum:has-more-elements-p ,e)
(enum:next ,e)
(terminate))))))
More information about the Cl-enumeration-cvs
mailing list