Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun gethashes (x &rest y) (dolist (z y x) (setf x (gethash z x))))
- (defsetf gethashes (table key &rest more-keys) (new-value)
- (if (null more-keys)
- `(setf (gethash ,key ,table) ,new-value)
- `(setf (gethashes (gethash ,key ,table) ,@more-keys) ,new-value)))
- (let ((table1 (make-hash-table))
- (table2 (make-hash-table)))
- (setf (gethash 'a table1) table2)
- (setf (gethashes table1 'a 14) 23)
- (gethashes table1 'a 14))
- => 23
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement