From mantoniotti at common-lisp.net Fri Sep 30 14:18:01 2011 From: mantoniotti at common-lisp.net (CVS User mantoniotti) Date: Fri, 30 Sep 2011 07:18:01 -0700 Subject: [cl-enumeration-cvs] CVS enumerations Message-ID: 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))))))