diff --git a/src/CHANGELOG b/src/CHANGELOG index 03fb61f1d..eba44c786 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -196,6 +196,8 @@ ECL 8.9.0: (...) ...) This is now solved by replacing parts of these types with the simple type FUNCTION. + - Hash tables were not properly serialized. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/clos/print.lsp b/src/clos/print.lsp index bd4913926..a20c90c33 100644 --- a/src/clos/print.lsp +++ b/src/clos/print.lsp @@ -104,7 +104,9 @@ printer and we should rather use MAKE-LOAD-FORM." :rehash-size ,(hash-table-rehash-size object) :rehash-threshold ,(hash-table-rehash-threshold object) :test ',(hash-table-test object)) - `(dolist (i ,(maphash (lambda (key obj) (cons key obj)) object)) + `(dolist (i ',(loop for key being each hash-key in object + using (hash-value obj) + collect (cons key obj))) (setf (gethash (car i) ,object) (cdr i))))) (t (error "Cannot externalize object ~a" object)))))