From 54a72498ced48e23d6e9f86dca8be588827a9d6a Mon Sep 17 00:00:00 2001 From: Yogthos Date: Wed, 24 Jun 2026 09:33:45 -0400 Subject: [PATCH] spec: note jolt's unknown-alias behavior; corpus rows for the reader/edn fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EBNF and reader S7 already specified ::kw auto-resolution — the implementation was out of spec, now aligned. S7 noted unknown ::alias/k MUST be a read error; jolt is lenient (reads :alias/k), so record that as a deviation. Corpus gains JVM-certified rows for ::kw resolution, clojure.edn :default receiving a symbol tag, and with-meta on a lazy seq. --- docs/spec/02-reader.md | 5 +++-- test/chez/corpus.edn | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/spec/02-reader.md b/docs/spec/02-reader.md index 88e782b..9b7c31a 100644 --- a/docs/spec/02-reader.md +++ b/docs/spec/02-reader.md @@ -59,8 +59,9 @@ keyword := ':' name | ':' ns '/' name | '::' name | '::' alias '/' name . $ & %` (with `%` and `&` further constrained inside `#()`); a symbol MUST NOT begin with a digit; `.` and `/` have positional restrictions. - S7. `::kw` MUST resolve to the current namespace at *read* time - (`::k` in ns `user` reads as `:user/k`); `::alias/k` resolves the alias or - MUST be a read error if the alias does not exist. + (`::k` in ns `user` reads as `:user/k`); `::alias/k` resolves `alias` through + the current namespace's aliases. (Clojure raises a read error for an unknown + alias; jolt reads it as `:alias/k`.) ### Strings and characters diff --git a/test/chez/corpus.edn b/test/chez/corpus.edn index f67b72f..95516a2 100644 --- a/test/chez/corpus.edn +++ b/test/chez/corpus.edn @@ -2648,6 +2648,8 @@ {:suite "reader / auto-resolved keywords" :label "::kw is namespace-qualified" :expected "true" :actual "(some? (namespace ::foo))"} {:suite "reader / auto-resolved keywords" :label "::kw keeps its name" :expected "\"foo\"" :actual "(name ::foo)"} {:suite "reader / auto-resolved keywords" :label "::kw resolves to the current ns" :expected "true" :actual "(= ::a ::a)"} + {:suite "clojure.edn / reader opts" :label ":default receives the tag as a symbol" :expected "[true \"foo\" 5]" :actual "(do (require (quote [clojure.edn :as edn])) (let [r (edn/read-string {:default (fn [t v] [t v])} \"#foo 5\")] [(symbol? (first r)) (name (first r)) (second r)]))"} + {:suite "metadata / lazy seqs carry meta" :label "with-meta on a lazy seq" :expected "{:k 1}" :actual "(meta (with-meta (map inc [1 2 3]) {:k 1}))"} {:suite "conformance / CRITICAL: lazy sequences" :label "self-ref lazy-cat fib" :expected "[0 1 1 2 3 5 8 13 21 34]" :actual "(do (def fib-seq (lazy-cat [0 1] (map + (rest fib-seq) fib-seq))) (take 10 fib-seq))"} {:suite "conformance / CRITICAL: multi-collection map" :label "map two colls" :expected "[11 22 33]" :actual "(map + [1 2 3] [10 20 30])"} {:suite "conformance / CRITICAL: multi-collection map" :label "map three colls" :expected "[12 24 36]" :actual "(map + [1 2 3] [10 20 30] [1 2 3])"}