Mine the cljs port batteries into the spec layer and delete them (their behavior
is covered by spec; the unique functions they exercised are now specced).
Removed test/integration/ports/ entirely.
New/expanded spec coverage from the mining:
- spec/exceptions-spec: try/catch/finally, throw, ex-info/ex-message/ex-data/ex-cause
- doto, pr-str, keyword/symbol constructors, atom?, dynamic var binding
Two rare edges filed (jolt-...): rethrow of a caught ex-info re-wraps it; var-set
on a dynamic var inside binding no-ops. Core try/catch/ex-info and binding work.
Test layout is now spec (22 files, ~677 cases) / integration / unit / support.
conformance 218/218, jpm test green.
Add behavioral spec suites for the collection API (~180 cases). Writing them
surfaced and fixed real bugs:
- (count nil) errored; now 0 (Clojure semantics)
- (repeat x) and (repeatedly f) — the infinite 1-arg arities — were unsupported;
now return lazy infinite seqs
- set equality used deep= (representation-sensitive), so a set of map literals
could differ from an equal set built differently; now value-based (each
element value-equal to some element of the other)
Known limitation filed: phm-typed maps (from hash-map) used as set elements /
map keys hash by identity (map *literals* are structs and work).
jpm test green.
Update stale claims: bigint/biginteger (int/s64), +'/*'/inc' aliases, transients
(correctness-only), and the byte-array-via-buffer / array family are now
implemented. Note clojure.repl/template and JVM reflection/proxy remain out.
Raw (deftype T [fields] Proto (method [this] body) ...) silently ignored its
protocol body — only the constructor was created, so protocol dispatch on a
deftype instance always failed (No method ... for T). defrecord worked only
because its macro expanded the body into extend-type forms.
deftype now does the same: emit an extend-type per protocol, wrapping each
method body in a let that binds the type's fields from the instance. This is a
real correctness fix (any deftype-with-protocols was broken) and unblocks SCI's
sci.lang.Var (a deftype implementing vars/IVar) — the clojure.core aggregation
map now gets past protocol dispatch.
conformance 218/218, features 78/78, jank 120.
While digging into test-load-sci, add genuinely-missing clojure.core fns:
doall/dorun/run!/tree-seq, key/val/map-entry?, rand-nth/replicate/
bounded-count/counted?/reversible?/seqable?, nat-int?/pos-int?/neg-int?/
double?/float?/ratio?/decimal?/rational?/numerator/denominator, list*,
special-symbol?/record?, promise/deliver, comparator/completing/halt-when/
ensure-reduced/unreduced, keyword-identical?/object?/tagged-literal/re-groups.
Fix a real pre-existing bug: iterating a map (first/seq/map/filter/reduce/vec/
realize-for-iteration) returned keys or values instead of [k v] entries.
Map literals are Janet structs (not phm), which several paths mishandled.
Now first/seq/realize-for-iteration yield entries for both structs and phms,
matching Clojure — e.g. (vec {:a 1}) => [[:a 1]], (map key m), (reduce f init m).
Tests: conformance 218/218 (+12), features 78/78, jank 120. Advances the SCI
bootstrap further (its clojure.core aggregation map resolves more symbols).
Resolve symbols that were unbound or leaking to broken Janet builtins:
- bit-clear/bit-set/bit-flip/bit-test/bit-and-not
- get-method/methods (multimethod introspection)
- second/ffirst/nfirst/fnext/nnext, last (was leaking to Janet, broke on pvec),
drop-last/take-last
- ident?/simple-symbol?/qualified-keyword?/simple-keyword?/simple-ident?/
qualified-ident?/inst?/inst-ms/uri?/uuid?/bytes?/tagged-literal?
- clojure.string/re-quote-replacement
Advances the SCI bootstrap; conformance 206/206, features 71/71.
Add src/jolt/config.janet exposing a build-time `mutable?` constant read from
JOLT_MUTABLE at compile time (jpm build). Default is immutable.
Fix correctness bug: conj on a list (Janet array) mutated the original in
place. In immutable mode conj now copies first; in mutable mode it mutates.
Round 1 of persistent-collections work.