Returning a hash-table iterator from a function?
Is there a way in LispWorks to return an iterator into a hash table
from a function? I don't think this is possible using standard CL.
For example, I'd like to do something like this:
(defun hti-closure (ht)
(with-hash-table-iterator (next ht)
(lambda () (next))))
(let ((ii (hti-closure my-hash-table)))
(multiple-value-bind (found? key value) (funcall ii)
(when found?
(format t "First key value is ~a ~a~%", key value))))
This won't work of course, but I was hoping there was a way to do the
equivalent in LispWorks.
Cheers,
Chris Dean