Class/forName honesty + class/isa? conformance for builtins
Class/forName claimed every java.*/clojure.* name found (and any "x.y.Class" matched the registered Class via a short-name fallback), so a library's (class-found? "optional.Dep") feature-probe always said yes — tools.logging then tried to build the java.util.logging / log4j backends jolt lacks and crashed. Resolve forName by exact registry lookup + an honest prefix that excludes the unbacked optional packages (java.util.logging, javax.management), so the probe sees them absent and skips the backend. class of a persistent collection / namespace now reports its JVM class name (clojure.lang.PersistentHashSet, …Namespace, …) instead of jolt's internal :set/ :object tag, and isa? consults JVM class assignability — Object as every class's root plus a modeled clojure.lang/java.util hierarchy — so (isa? (class x) C) and a class-keyed multimethod dispatch like the JVM (e.g. (isa? Keyword Object) was false). Adds the bare class tokens (Fn/Namespace/Set/…) these dispatch on. (type x) is unchanged — it keeps jolt's documented internal-keyword form. Six JVM-certified corpus rows. make test green, 0 new divergences.
This commit is contained in:
parent
283a0f0eec
commit
e5563ba375
6 changed files with 80 additions and 5 deletions
|
|
@ -302,6 +302,9 @@
|
|||
([child parent] (isa? (deref global-hierarchy) child parent))
|
||||
([h child parent]
|
||||
(or (= child parent)
|
||||
;; JVM class assignability (Object root + modeled clojure.lang/java.* ancestry),
|
||||
;; so a class-keyed multimethod / (isa? (class x) C) dispatches like the JVM.
|
||||
(jolt.host/class-isa? child parent)
|
||||
(contains? (get (get h :ancestors) child #{}) parent)
|
||||
(and (vector? parent) (vector? child)
|
||||
(= (count parent) (count child))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue