[Bug-openmcl] type cache
bryan-openmcl at lunch.org
Wed Feb 25 13:23:15 MST 2004
> is there anything in the spec which says anything about
> a list that's used as a type specifier can be destructively modified ?
not that i have seen.
i think regardless of immutability, if things* like this are
allowed then the cache has problems because two similar but
different types hash the same. (i haven't convinced myself
that things like this are used much outside of test suites)
(let* ((o1 '(foo bar))
(x1 `(member ,o1))
(o2 '(foo bar))
(x2 `(member ,o2)))
(ccl::hash-type-specifier x1) ; hashes to 710.
(typep o1 x1)
(typep o2 x1)
(ccl::hash-type-specifier x2) ; hashes to 710.
(typep o1 x2)
(typep o2 x2))))
with a cache enabled image, we get (values 710 T NIL 710 T NIL)
without, the expected (avoiding the use of "correct" here) result
(values 710 T NIL 710 NIL T).
although this case is written as one form, it could be two separate
forms where o1/x1 have fallen out of scope before o2/x2 are bound.
the type cache still has the previous type-spec keyed at 710. this
test form just shows that x1 is still in scope, so cache invalidation
wouldn't solve this specific issue.
this is what is causing the previously mentioned subtype failures.
some tests use the same literals for the type-specs.
* "things" for lack of the right vocabulary.
More information about the Bug-openmcl