From d5deba2df877855289fcc320681cacd687e3429b Mon Sep 17 00:00:00 2001 From: Yogthos Date: Wed, 24 Jun 2026 10:22:10 -0400 Subject: [PATCH] Define *print-meta* as a bindable dynamic var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clojure.core/*print-meta* was missing, so (binding [*print-meta* true] …) failed to compile ("var of non-var"). Add it (default false, like the JVM); corpus covers binding it. --- host/chez/dynamic-var-defaults.ss | 3 +++ test/chez/corpus.edn | 1 + 2 files changed, 4 insertions(+) diff --git a/host/chez/dynamic-var-defaults.ss b/host/chez/dynamic-var-defaults.ss index 8fc26ac..387e048 100644 --- a/host/chez/dynamic-var-defaults.ss +++ b/host/chez/dynamic-var-defaults.ss @@ -25,3 +25,6 @@ ;; *print-readably* — bound by pr-family / with-out-str-style code; default true. (def-var! "clojure.core" "*print-readably*" #t) + +;; *print-meta* — when true, pr prints metadata with a ^ prefix; default false. +(def-var! "clojure.core" "*print-meta*" #f) diff --git a/test/chez/corpus.edn b/test/chez/corpus.edn index 95516a2..76c54ee 100644 --- a/test/chez/corpus.edn +++ b/test/chez/corpus.edn @@ -2650,6 +2650,7 @@ {: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 "dynamic vars / *print-meta*" :label "*print-meta* is a bindable dynamic var" :expected "true" :actual "(binding [*print-meta* true] (true? *print-meta*))"} {: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])"}