Chez parity: delay / force / realized? (jolt-cf1q.7)

Add a thread-safe delay type (concurrency.ss): make-delay wraps a thunk; deref/
force run it once under a lock and cache (JVM delays are thread-safe + memoized).
delay? and realized?-on-a-delay are native; the overlay's `delay` macro
(-> make-delay) and `force` (-> deref) now work. realized? wrapper (post-prelude)
and the deref chain gain a delay arm. Removed the np-delay? stub from
natives-parity.ss (the real type lives in concurrency.ss).

Seed unchanged (no re-mint). zero-Janet 2673->2685, 0 new divergences; Janet gate
+ JVM cert green.

jolt-cf1q.7
This commit is contained in:
Yogthos 2026-06-20 17:02:42 -04:00
parent 4b4d677fe4
commit 1d6e740668
4 changed files with 26 additions and 11 deletions

View file

@ -62,9 +62,7 @@
(define (np-re-matcher re s)
(jolt-hash-map np-kw-type np-kw-mat np-kw-re re np-kw-s s np-kw-pos 0.0))
;; --- delay? : no delay type is built on Chez yet, so always false (enough for
;; (delay? x) on non-delays; revisit when delay/force land).
(define (np-delay? x) #f)
;; (delay? / make-delay / force live in concurrency.ss with the real delay type.)
;; --- macroexpand-1 / macroexpand: expand a (quoted) call form via the runtime
;; macro table (host-contract hc-macro?/hc-expand-1; forward-referenced, resolved
@ -90,6 +88,5 @@
(def-var! "clojure.core" "__reader-features-set!" np-reader-features-set!)
(def-var! "clojure.core" "reader-conditional" np-reader-conditional)
(def-var! "clojure.core" "re-matcher" np-re-matcher)
(def-var! "clojure.core" "delay?" np-delay?)
(def-var! "clojure.core" "macroexpand-1" np-macroexpand-1)
(def-var! "clojure.core" "macroexpand" np-macroexpand)