Run core.memoize's test suite on jolt
Shaking out clojure.core.memoize (207 assertions, 0 fail) cleared several
general gaps:
- deref/@ on a deftype or reify implementing clojure.lang.IDeref dispatches to
its deref method (RetryingDelay / make-derefable).
- deftype mutable fields (^:unsynchronized-mutable / ^:volatile-mutable) are
read live: a set! within a method is observed by a later read in the same
invocation, not the entry-time capture. Needed for double-checked locking.
Immutable fields stay let-bound. Field reads rewrite to (.-field inst) with
lexical-shadow tracking.
- def metadata values are evaluated, like Clojure: ^{:k (f)} stores (f)'s
result and ^{:af some-fn} the fn. :tag stays a literal hint.
- try dispatches catch clauses by class in order via the exception supertype
hierarchy; a non-matching value re-throws, an untyped host condition is caught
by a RuntimeException/Exception/Throwable clause. Previously the last clause
won and the class was ignored.
- locking takes a real per-object monitor (recursive Chez mutex) now that
futures/agents/threads share one heap; it was a no-op.
- supers/ancestors reflect a small modeled JVM interface hierarchy, so
(ancestors (class f)) yields Runnable/Callable (core.memoize's arg check).
- AssertionError / Error constructors.
JOLT_FEATURES is gone from the docs: it isn't read anywhere on Chez, and the
reader already includes :clj in its default feature set. RFC 0002's
{:jolt :default} design was reverted in the reader; docs now match the code.
Raises the SCI floor 205 -> 210.
This commit is contained in:
parent
3dde290f1a
commit
d21ab77e7e
18 changed files with 1179 additions and 939 deletions
|
|
@ -1,9 +1,22 @@
|
|||
# RFC 0002 — Reader-Conditional Feature Set
|
||||
|
||||
- **Status**: Accepted (implemented; measured)
|
||||
- **Status**: Superseded (2026-06-25) — jolt now includes `:clj` in the default
|
||||
set; see the note below.
|
||||
- **Created**: 2026-06-10
|
||||
- **Spec**: `docs/spec/02-reader.md` §2.3 S18
|
||||
|
||||
> **Update (2026-06-25).** The default set is now **`#{:jolt :clj :default}`** —
|
||||
> `:clj` is satisfied by default. The clj ecosystem's `.cljc` libraries gate
|
||||
> their host code behind `#?(:clj …)` with no `:jolt`/`:default` fallback, so
|
||||
> the conformance libraries (core.cache, core.match, tick, malli, …) only load
|
||||
> with `:clj` present; requiring an opt-in for each was friction with no payoff
|
||||
> once jolt's `clojure.lang.*`/`java.*` emulation was broad enough to run those
|
||||
> `:clj` branches. Matching is still by **clause order**, so a library can place
|
||||
> a `:jolt` branch first to override. There is no `JOLT_FEATURES` environment
|
||||
> variable; a loading context overrides the set at runtime with
|
||||
> `reader-features-set!`. The rest of this RFC is the original (reverted)
|
||||
> design.
|
||||
|
||||
## Summary
|
||||
|
||||
jolt's reader-conditional feature set is **`#{:jolt :default}`**, matched in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue