Class-name symbols self-evaluate; extends? matches host classes; ISO_INSTANT
A slash-free dotted symbol with a Capitalized final segment (java.util.Map, clojure.lang.Named, java.time.Instant) now self-evaluates to its name string instead of resolving to nil — jolt models a class as its name, so a library can extend a protocol to, or instance?-check, a host class jolt has no shim for. hc-resolve-global classifies these as :class; the analyzer emits a const. extends? now matches when either the query or the registered tag is a dotted suffix of the other, so (extends? P java.util.Collection) finds the impl extend registered under the canonical short tag. Add DateTimeFormatter/ISO_INSTANT (UTC, trailing Z). These unblock loading clojure.data.json, which dispatches JSONWriter on java.util.Map/Collection/CharSequence/Instant and defaults a formatter to ISO_INSTANT.
This commit is contained in:
parent
c26fd175f2
commit
21895cb932
7 changed files with 552 additions and 526 deletions
|
|
@ -516,6 +516,9 @@
|
|||
;; jolt.passes.numeric types a call to it (an accumulator over the result).
|
||||
:var (cond-> (var-ref (:ns r) (:name r)) (:num-ret r) (assoc :num-ret (:num-ret r)))
|
||||
:host (host-ref (:name r))
|
||||
;; a class-name symbol (java.util.Map) self-evaluates to its name
|
||||
;; string — jolt models a class as its name, with no JVM classes.
|
||||
:class (const (:name r))
|
||||
;; :unresolved — emitting a var-ref here would auto-intern an
|
||||
;; UNBOUND var, so a typo'd symbol would die later as 'Cannot call
|
||||
;; nil as a function' with no hint which symbol.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue