Christophe Weblog Wiki Code Publications Music
new protocol function GENERALIZER-EQUAL-HASH-KEY
authorChristophe Rhodes <csr21@cantab.net>
Mon, 16 Dec 2013 16:30:05 +0000 (16:30 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Mon, 16 Dec 2013 16:30:05 +0000 (16:30 +0000)
commit4f8b7a9cbde446b6576f81178534abe8b47659a1
tree9a7b3fa5b42323a152a08b2be57884e388d12377
parentde2944d5e7a9c5f1b7ee3c32c12cbda71832f6fe
new protocol function GENERALIZER-EQUAL-HASH-KEY

We need arbitrary generalizer objects, not least so as to have
composable specializer functions (if we want generic functions
which can have more than one extended specializer class, we need
to be sure that our generalizers won't stomp on each other).

But that means that cacheing effective methods depends totally on
interning generalizers, which is a bit lame, unless we ask the
extended specializer implementor to provide a subkey to be used
in the key to the emf cache.  This new protocol function is a hook
for exactly that purpose.

(Minimally update the cons specializer example: it's still bad, in
that it uses symbols as the generalizer for conses, but the protocol
in principle at least doesn't leak now.)
cons-specializer.lisp
specializable.lisp