definterface returns the name (not a var); ns-imports returns java.lang defaults

definterface now expands to (do (def name {}) 'name) so (var? (definterface ...))
is false, matching the JVM where it yields the interface Class. ns-imports returns
the 96 auto-imported java.lang classes (short symbol -> canonical name) so
(count (ns-imports 'user)) is 96. Re-minted for the macro change. Corpus 2718->2720.
This commit is contained in:
Yogthos 2026-06-21 22:47:23 -04:00
parent 9e0a930eb4
commit 632a90cae2
4 changed files with 39 additions and 9 deletions

View file

@ -415,8 +415,10 @@
;; extend is a real FUNCTION now — defined above extend-type.
;; JVM proxies are unsupported.
(defmacro proxy [& args] nil)
;; definterface is JVM-only; bind the name to an empty marker.
(defmacro definterface [name-sym & body] `(def ~name-sym {}))
;; definterface is JVM-only; bind the name to a marker and return the name (not a
;; var), matching the JVM where definterface yields the interface Class.
(defmacro definterface [name-sym & body]
`(do (def ~name-sym {}) (quote ~name-sym)))
;; make-reified is a fn (clojure.core); the method map {kw (fn* ...)} is an
;; ordinary map literal that evaluates to {keyword fn}, and the protocol NAME is