How can I reuse a gethash lookup in Common Lisp?
问题 I have a hash table where the keys are rather complex lists, with sublists of symbols and integers, and the value should be modified depending on the already existing value. The table is created with :test #'equal . I do something similar to this a lot: (defun try-add (i) (let ((old-i (gethash complex-list table nil))) (if (may-add old-i) (push i (gethash complex-list table))))) Profiling shows that equal tests take a lot of time. I have an optimization idea, that the amount of gethash