Phase 14 fixes: pr-str mapping, every-pred, PLAN.md update

- compiler.janet: fix core-pr-str mapping — was pointing to core-str (line 221)
- core.janet: add core-pr-str (string/format-based serialization with proper quoting),
  add core-every-pred (variadic predicate composition), wire both into core-bindings
- cljs-port-5.janet: restore var-dynamic? test, with-meta preserves test,
  add pr-str keyword and every-pred assertions
- PLAN.md: update to current state — all phases 0-14 checked off, 316/317

316 ok, 1 fail (pre-existing, unchanged)
This commit is contained in:
Yogthos 2026-06-03 17:12:29 -04:00
parent 6b0fdefc61
commit 84d92c1008
6 changed files with 136 additions and 37 deletions

View file

@ -1,7 +1,5 @@
REPL print-value uses buffer-based output: write-value/v buf appends formatted strings via buffer/push-string, then print-value creates buffer, builds string, and does a single (print (string buf)). This prevents Janet C runtime from interleaving native <tuple 0x...> output between prin statements in jpm build executables. Cond catch-all must use true clause: Janet's cond treats plain expressions as tests, so (push-str buf (string v)) at end of cond would be evaluated as a test — need true before it.
§
Post-Phase 11: 316 passing, 1 fail (pre-existing array/table/buffer in SCI lang.cljc, deferred to Phase 15). 7,800+ lines across ~20 source/test files. 9 .clj stdlib modules (clojure/string.clj, set.clj, walk.clj, zip.clj, edn.clj, java_io.clj; jolt/interop.clj, shell.clj, http.clj). 85 CLJS-ported assertions. SCI stub file at src/jolt/clojure/sci/lang_stubs.clj provides 5 protocols + 3 deftypes. 24 test files. All builds/runs via `jpm test`.
§
Project stats after Phase 12: 7,800+ lines across 30+ source/test files. Key sources: compiler.janet (848 lines), evaluator.janet (869 lines), core.janet (1387 lines), types.janet (441 lines), reader.janet (472 lines), phm.janet (199 lines), main.janet (125 lines), api.janet (93 lines), loader.janet (79 lines). Test suite: 316 ok, 1 fail (pre-existing deftype in lang.cljc). 17 CLJS-ported test files + 6 custom test files. 9 .clj standard library modules under src/jolt/clojure/ and src/jolt/jolt/. All builds/runs via `jpm test`.
Post-Phase 13: 316/317 passing, 1 fail (pre-existing deftype in SCI lang.cljc, deferred to Phase 15). 8,000+ lines across ~25 source/test files. Key sources: compiler.janet (848), evaluator.janet (877), core.janet (1387), types.janet (441), reader.janet (500), phm.janet (199). 9 .clj stdlib modules (clojure/string.clj, set.clj, walk.clj, zip.clj, edn.clj, java_io.clj; jolt/interop.clj, shell.clj, http.clj). SCI stub file at src/jolt/clojure/sci/lang_stubs.clj provides 5 protocols + 3 deftypes. ~25 test files with 850+ assertions. CLJS-ported tests: 6 files, 27 sections, ~120 assertions. All builds/runs via `jpm test`.
§
Protocol system: Type registry in context env (:type-registry) maps type-tag→proto-name→method-name→fn. Three dispatch special forms: protocol-dispatch (resolves method via registry or reified methods), register-method (stores impl in registry), make-reified (creates anonymous object with :jolt/protocol-methods). fn* forms emitted by extend-type/extend-protocol MUST be @[...] (array) for eval-list dispatch. Protocols are maps with :jolt/type :jolt/protocol and :methods map.

View file

@ -1,5 +1,3 @@
Janet `and` returns last truthy value, not boolean. `(and table? deftype)` returns the deftype string, not true. Predicate-like functions (core-map?, core-contains?, etc.) that check type tags via `(and ...)` must wrap in `(if ... true false)`. Hit us with core-map? returning the deftype string instead of boolean true for record instances. Also hit type-satisfies? which had to replace `(boolean ...)` (nonexistent) with `(if ... true false)`.
§
Janet `and` returns last truthy value, not boolean. `(and table? deftype)` returns the deftype string, not true. Predicate-like functions (core-map?, core-contains?, etc.) that check type tags via `(and ...)` must wrap in `(if ... true false)`. Examples: core-map? returning deftype string instead of boolean true for record instances. Also applies to type-satisfies? which must use `(if (and ...) true false)` — Janet has no `boolean` function.
§
Clojure .clj source files loaded via eval-form cannot have docstrings. If a defn form has 5 elements (defn, name, docstring, params, body), the evaluator's defn macro handler gets 4 args instead of 3, breaking with "macro arity mismatch". All .clj files in src/jolt/clojure/ must use 4-element defn forms: (defn name [params] body). Docstrings on defn are a Clojure feature not supported by Jolt's defn macro.

View file

@ -1,23 +1,23 @@
{
"jolt-gotchas": {
"jolt-dev": {
"created_by": "agent",
"use_count": 4,
"view_count": 256,
"patch_count": 4,
"last_used_at": "2026-06-03T16:12:06.850822+00:00",
"last_viewed_at": "2026-06-03T17:19:39.580796+00:00",
"last_patched_at": "2026-06-03T16:12:23.546648+00:00",
"created_at": "2026-06-03T03:50:41.474730+00:00",
"use_count": 41,
"view_count": 342,
"patch_count": 48,
"last_used_at": "2026-06-03T17:22:40.281198+00:00",
"last_viewed_at": "2026-06-03T21:12:16.003609+00:00",
"last_patched_at": "2026-06-03T17:02:24.207040+00:00",
"created_at": "2026-06-01T21:26:06.614465+00:00",
"state": "active",
"pinned": false
},
"jolt-bootstrap": {
"created_by": "agent",
"use_count": 9,
"view_count": 277,
"view_count": 310,
"patch_count": 10,
"last_used_at": "2026-06-02T18:45:23.336653+00:00",
"last_viewed_at": "2026-06-03T17:19:39.564734+00:00",
"last_viewed_at": "2026-06-03T21:12:15.990953+00:00",
"last_patched_at": "2026-06-02T03:44:45.935676+00:00",
"created_at": "2026-06-01T21:49:51.101718+00:00",
"state": "active",
@ -26,20 +26,32 @@
"jolt-persistent-structures": {
"created_by": "agent",
"use_count": 3,
"view_count": 256,
"view_count": 289,
"patch_count": 0,
"last_used_at": "2026-06-03T16:13:31.440242+00:00",
"last_viewed_at": "2026-06-03T17:19:39.585778+00:00",
"last_viewed_at": "2026-06-03T21:12:16.015079+00:00",
"created_at": "2026-06-03T03:35:04.130959+00:00",
"state": "active",
"pinned": false
},
"jolt-gotchas": {
"created_by": "agent",
"use_count": 5,
"view_count": 290,
"patch_count": 4,
"last_used_at": "2026-06-03T17:22:40.328839+00:00",
"last_viewed_at": "2026-06-03T21:12:16.009503+00:00",
"last_patched_at": "2026-06-03T16:12:23.546648+00:00",
"created_at": "2026-06-03T03:50:41.474730+00:00",
"state": "active",
"pinned": false
},
"jpm-build": {
"created_by": "agent",
"use_count": 0,
"view_count": 268,
"view_count": 301,
"patch_count": 0,
"last_viewed_at": "2026-06-03T17:19:39.591024+00:00",
"last_viewed_at": "2026-06-03T21:12:16.020749+00:00",
"created_at": "2026-06-01T20:56:39.144222+00:00",
"state": "active",
"pinned": false
@ -47,25 +59,13 @@
"jolt-compiler": {
"created_by": "agent",
"use_count": 12,
"view_count": 269,
"view_count": 302,
"patch_count": 10,
"last_used_at": "2026-06-03T16:35:41.304993+00:00",
"last_viewed_at": "2026-06-03T17:19:39.570381+00:00",
"last_viewed_at": "2026-06-03T21:12:15.997462+00:00",
"last_patched_at": "2026-06-03T16:13:25.725903+00:00",
"created_at": "2026-06-02T17:54:38.690279+00:00",
"state": "active",
"pinned": false
},
"jolt-dev": {
"created_by": "agent",
"use_count": 40,
"view_count": 308,
"patch_count": 48,
"last_used_at": "2026-06-03T17:02:10.695363+00:00",
"last_viewed_at": "2026-06-03T17:19:39.575770+00:00",
"last_patched_at": "2026-06-03T17:02:24.207040+00:00",
"created_at": "2026-06-01T21:26:06.614465+00:00",
"state": "active",
"pinned": false
}
}