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:
parent
9e0a930eb4
commit
632a90cae2
4 changed files with 39 additions and 9 deletions
|
|
@ -158,8 +158,36 @@
|
|||
(hashtable-keys ns-refer-table))
|
||||
m))
|
||||
|
||||
;; ns-imports: Chez has no Java class imports -> always the empty map.
|
||||
(define (jolt-ns-imports . _) (jolt-hash-map))
|
||||
;; ns-imports: clojure.core auto-imports the 96 public java.lang classes into
|
||||
;; every ns. jolt has no classloader, but returns that map (short symbol ->
|
||||
;; canonical class-name token) so (count (ns-imports 'user)) = 96 like the JVM.
|
||||
(define jolt-default-import-names
|
||||
'("AbstractMethodError" "Appendable" "ArithmeticException" "ArrayIndexOutOfBoundsException"
|
||||
"ArrayStoreException" "AssertionError" "BigDecimal" "BigInteger" "Boolean" "Byte"
|
||||
"Callable" "CharSequence" "Character" "Class" "ClassCastException" "ClassCircularityError"
|
||||
"ClassFormatError" "ClassLoader" "ClassNotFoundException" "CloneNotSupportedException"
|
||||
"Cloneable" "Comparable" "Compiler" "Deprecated" "Double" "Enum"
|
||||
"EnumConstantNotPresentException" "Error" "Exception" "ExceptionInInitializerError" "Float"
|
||||
"IllegalAccessError" "IllegalAccessException" "IllegalArgumentException"
|
||||
"IllegalMonitorStateException" "IllegalStateException" "IllegalThreadStateException"
|
||||
"IncompatibleClassChangeError" "IndexOutOfBoundsException" "InheritableThreadLocal"
|
||||
"InstantiationError" "InstantiationException" "Integer" "InternalError" "InterruptedException"
|
||||
"Iterable" "LinkageError" "Long" "Math" "NegativeArraySizeException" "NoClassDefFoundError"
|
||||
"NoSuchFieldError" "NoSuchFieldException" "NoSuchMethodError" "NoSuchMethodException"
|
||||
"NullPointerException" "Number" "NumberFormatException" "Object" "OutOfMemoryError" "Override"
|
||||
"Package" "Process" "ProcessBuilder" "Readable" "Runnable" "Runtime" "RuntimeException"
|
||||
"RuntimePermission" "SecurityException" "SecurityManager" "Short" "StackOverflowError"
|
||||
"StackTraceElement" "StrictMath" "String" "StringBuffer" "StringBuilder"
|
||||
"StringIndexOutOfBoundsException" "SuppressWarnings" "System" "Thread" "Thread$State"
|
||||
"Thread$UncaughtExceptionHandler" "ThreadDeath" "ThreadGroup" "ThreadLocal" "Throwable"
|
||||
"TypeNotPresentException" "UnknownError" "UnsatisfiedLinkError" "UnsupportedClassVersionError"
|
||||
"UnsupportedOperationException" "VerifyError" "VirtualMachineError" "Void"))
|
||||
(define jolt-default-imports
|
||||
(let loop ((ns jolt-default-import-names) (m (jolt-hash-map)))
|
||||
(if (null? ns) m
|
||||
(loop (cdr ns)
|
||||
(jolt-assoc m (jolt-symbol #f (car ns)) (string-append "java.lang." (car ns)))))))
|
||||
(define (jolt-ns-imports . _) jolt-default-imports)
|
||||
|
||||
;; resolve: an unqualified symbol resolves in the current ns then clojure.core; a
|
||||
;; qualified one in its own ns. Returns the var iff genuinely defined, else nil —
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
;; reset between cases so there is no leakage — same isolation a fresh process gives.
|
||||
;;
|
||||
;; chez --script host/chez/run-corpus.ss
|
||||
;; JOLT_CHEZ_ZJ_FLOOR=N override the regression floor (default 2718)
|
||||
;; JOLT_CHEZ_ZJ_FLOOR=N override the regression floor (default 2720)
|
||||
;; JOLT_CORPUS_LIMIT=N every-Nth stride (fast iteration; floor drops to 0)
|
||||
;; JOLT_DUMP_CRASH_LABELS=1 list crash + allowlisted labels
|
||||
(import (chezscheme))
|
||||
|
|
@ -86,11 +86,11 @@
|
|||
;; transients/atoms/Infinity. These DIVERGE but are tolerated; the gate fails only on
|
||||
;; a NEW (unlisted) divergence or a drop below the floor.
|
||||
(define known-fail-labels
|
||||
'("definterface defines" "getMessage on a thrown string"
|
||||
'("getMessage on a thrown string"
|
||||
"type of record" "chunked-seq? always false"
|
||||
"^Type tag on var" "symbol hint -> :tag"
|
||||
"lists extended type" "seq of tags"
|
||||
"close on throw" "macroexpand-1" "ns-imports empty user"
|
||||
"close on throw" "macroexpand-1"
|
||||
"bean is the map" "proxy resolves nil"
|
||||
"*in* is bound" "*in* bound"
|
||||
"bigdec" "bigdec int M" "bigdec suffix M"
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
|
||||
;; Regression floor: fail on any NEW divergence or if pass drops below the floor.
|
||||
(define base-floor (let ((s (getenv "JOLT_CHEZ_ZJ_FLOOR")))
|
||||
(if s (string->number s) 2718)))
|
||||
(if s (string->number s) 2720)))
|
||||
(define floor (if limit 0 base-floor))
|
||||
(when (or (> (length diverged) 0) (< pass floor))
|
||||
(printf "REGRESSION: pass ~a < floor ~a or ~a new divergence(s)\n"
|
||||
|
|
|
|||
|
|
@ -908,7 +908,7 @@
|
|||
(mark-macro! "clojure.core" "proxy"))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "definterface"
|
||||
(lambda (name-sym . body) (let fnrec484 ((name-sym name-sym) (body (list->cseq body))) (jolt-invoke (var-deref "clojure.core" "__sqcat") (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-symbol #f "def")) (jolt-invoke (var-deref "clojure.core" "__sq1") name-sym) (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-invoke (var-deref "clojure.core" "__sqmap") ))))))
|
||||
(lambda (name-sym . body) (let fnrec484 ((name-sym name-sym) (body (list->cseq body))) (jolt-invoke (var-deref "clojure.core" "__sqcat") (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-symbol #f "do")) (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-invoke (var-deref "clojure.core" "__sqcat") (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-symbol #f "def")) (jolt-invoke (var-deref "clojure.core" "__sq1") name-sym) (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-invoke (var-deref "clojure.core" "__sqmap") )))) (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-invoke (var-deref "clojure.core" "__sqcat") (jolt-invoke (var-deref "clojure.core" "__sq1") (jolt-symbol #f "quote")) (jolt-invoke (var-deref "clojure.core" "__sq1") name-sym)))))))
|
||||
(mark-macro! "clojure.core" "definterface"))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "reify"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue