(let (a b (c 0) (table (make-hash-table))) (setf (gethash 0 table) 0) (setf (gethash 1 table) 1) (block NIL (flet ((thunk (k v) (declare (ignore v)) (case c (0 (setf a k)) (1 (setf b k)) (T (return NIL))) (incf c))) (declare (dynamic-extent #'thunk)) (maphash #'thunk table))))