On Mar 10, 2008, at 14:20 , Tobias C. Rittweiler wrote:
The following patch adds a :COPY-FN &key arg to COPY-HASH-TABLE which defaults to CL:IDENTITY.
Why not this?
(defun copy-hash-table (table &key key ...) ... - (setf (gethash k copy) v)) + (setf (gethash k copy) (if key (funcall key v) v)) ...)
Also, I'd rather have other parameters get their default values when they are NIL, in the cases when it makes sense. E.g., with the above I can do
(defun foo (&key key) (copy-hash-table *table* :key key))
without having to worry about the default values.
Cheers, Michael