From f7b3718286f69e1453ff563f8e6cccab8501afa0 Mon Sep 17 00:00:00 2001 From: Utz-Uwe Haus Date: Tue, 22 Jun 2010 10:45:00 +0200 Subject: [PATCH] Fix macro expansion time confusion in with-index-hash Signed-off-by: Utz-Uwe Haus --- satwrap.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/satwrap.lisp b/satwrap.lisp index f7e11aa..bc86495 100644 --- a/satwrap.lisp +++ b/satwrap.lisp @@ -212,7 +212,7 @@ Returns a list of literals fixed, sign according to phase.") (locally ,@body))) -(defmacro with-index-hash ((mapping &key (test 'cl:eq)) objects &body body) +(defmacro with-index-hash ((mapping &key (test 'eq)) objects &body body) "Execute BODY while binding MAPPING to a hash-table (with predicate TEST, defaults to #'cl:eq) mapping the elements of the sequence OBJECTS to integer 1..[length objects]. @@ -220,12 +220,12 @@ Typically used to map objects to variables inside WITH-SAT-SOLVER." (let ((o (gensym "objects"))) `(let* ((,o ,objects) (,mapping (etypecase ,o - (list (loop :with ht := (make-hash-table :test ,test) + (list (loop :with ht := (make-hash-table :test #',test) :for x :in ,o :for num :of-type fixnum :from 1 :do (setf (gethash x ht) num) :finally (return ht))) - (vector (loop :with ht := (make-hash-table :test ,test) + (vector (loop :with ht := (make-hash-table :test #',test) :for x :across ,o :for num :of-type fixnum :from 1 :do (setf (gethash x ht) num) -- 2.11.4.GIT