You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2828448
Browse filesBrowse the repository at this point in the historyBrowse files
feat(meta): D-563(b) — Var :line/:column/:file source meta; def meta rides the AOT wire (envelope v9)
Smell-audited: 2: the meta-as-code design pivoted twice in-cycle (analyze
raw → NameError on defn's raw :arglists lists; measured that quoted
composites DO round-trip the wire) and settled on wholesale-quote = ONE
composite constant preserving cljw's static-data meta semantics — the
measurement-first pivot is recorded here + in the debt row. defmacro's
def_node meta_expr is a named residual (D-563 row).
- analyzeDef mints {:line :column :file} under user ^meta/:doc (compiler
wins on collision — clj-oracle: ^{:line 999} yields the real line).
- DefNode.meta_expr evaluated at def time by BOTH backends: tree_walk
evalDef + new op_var_meta (0x56; pops meta, sets Var.meta, var stays).
Dual-backend contract: TreeWalk arm + compile arm + dispatch arm +
diff case in this commit.
- fix(aot): def meta now survives `cljw build` artifacts — docstrings
were silently LOST in built apps ((:doc (meta #'f)) → nil) while the
lazy-source bootstrap kept them; envelope v8 → v9 (new opcode).
- clojure.test FAIL/ERROR lines regain the ` (file:line)` suffix from
the deftest var's meta; AD-041 NARROWED (cljw points at the deftest
line, clj at the assertion's stack line — no JVM stack to read).
e2e phase15_var_source_meta (8 cases incl. AOT round-trip + fixture
file line/path) + phase15_clojure_test_output pins updated.
Copy file name to clipboardExpand all lines: .dev/accepted_divergences.yaml
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -599,20 +599,21 @@ accepted:
599
599
derives_from: "F-011 (behavioural equivalence is the contract; the macros run identically — only the intermediate macroexpand-1 FORM differs; cljw's Zig transforms lower eagerly in one step). Functionally-equivalent expansion form, like ClojureScript's macroexpansions vs JVM clj."
600
600
pin: "test/e2e/phase14_when_if_not.sh — `cond_expand_full` locks (macroexpand-1 '(cond a 1 :else 2)) => (if a 1 (if :else 2 nil)) (cljw's full form), and `when_expand_multi`/`when_expand_single` lock when's byte-match with clj"
601
601
- id: "AD-041"
602
-
summary: "clojure.test's FAIL/ERROR report line omits clj's ` (file:line)` source-location suffix, and `report :error` prints the exception's value instead of clj's JVM cause trace. The test name, expected/actual, context line, and counts all match clj."
603
-
example: "(deftest a (is (= 1 2))) (run-tests) => cljw `FAIL in (a)` / clj `FAIL in (a) (NO_SOURCE_FILE:1)`. An erroring test: cljw ` actual: #error {…}` (the ex value) / clj a multi-line `clojure.lang.ExceptionInfo … at …` cause trace."
604
-
why: |-
605
-
cljw Vars carry no source location — `(meta #'a)` has `:name`/`:ns` but no
606
-
`:line`/`:file` (clj attaches both at compile time). So `testing-vars-str`
607
-
cannot emit the ` (file:line)` suffix clj appends, and there is no JVM
608
-
stack to print for an errored assertion. Everything that does NOT depend on
609
-
a source location — the `(test-name)` list, `expected:`/` actual:` (incl.
610
-
the clj `(not (= …))` actual form), the joined `testing` context line, the
611
-
`Testing <ns>` begin line, and the `Ran … / failures, errors.` summary —
612
-
matches clj byte-for-line. Reproducing the suffix/trace would require a
613
-
source-location + JVM-stack model cljw does not have (ADR-0059 no-JVM).
602
+
summary: "clojure.test's FAIL/ERROR ` (file:line)` suffix points at the DEFTEST var's line (from Var source meta, D-563b) where clj points at the failing assertion's line (JVM stack frame); and `report :error` prints the exception's value instead of clj's JVM cause trace. Names, expected/actual, context, and counts all match clj."
603
+
example: "(deftest a (is (= 1 2))) in f.clj: cljw `FAIL in (a) (f.clj:LINE-OF-DEFTEST)` / clj `FAIL in (a) (f.clj:LINE-OF-IS)`. An erroring test: cljw ` actual: #error {…}` (the ex value) / clj a multi-line `clojure.lang.ExceptionInfo … at …` cause trace."
604
+
why: |-
605
+
Since D-563(b) cljw Vars DO carry `:line`/`:column`/`:file` source meta
606
+
(compiler-minted, AOT-wire-carried), so `testing-vars-str` emits the
607
+
` (file:line)` suffix — but from the deftest VAR's meta. clj derives it
608
+
from the failing ASSERTION's stack frame, and cljw has no JVM stack to
609
+
read (ADR-0059), so cljw points at the deftest line where clj points at
610
+
the `is` line. The `report :error` cause-trace half is unchanged (no JVM
611
+
stack to print). Everything else — the `(test-name)` list,
612
+
`expected:`/` actual:` (incl. the clj `(not (= …))` form), the joined
613
+
`testing` context line, `Testing <ns>`, and the summary — matches clj
614
+
byte-for-line.
614
615
derives_from: "ADR-0059 (no-JVM: no JVM stack / class-file source positions) + F-011 (behavioural equivalence — pass/fail/error outcomes + counts match; only the unreproducible location/trace text differs)."
615
-
pin: "test/e2e/phase15_clojure_test_output.sh — asserts the clj-matching lines (`FAIL in (eqfail)`, ` actual: (not (= 1 2))`, context, `Testing demo`, summary) are present and that `*test-out*` is re-enabled; the absent ` (file:line)` suffix is the locked divergence."
616
+
pin: "test/e2e/phase15_clojure_test_output.sh (suffix present, deftest-var-sourced) + test/e2e/phase15_var_source_meta.sh (the Var meta channel + AOT round-trip)."
616
617
- id: "AD-042"
617
618
summary: "`(pr-str v)` / `(str v)` print the bare ISO toString for a `java.time.*` value (Instant, Duration, …), where clj's `pr` emits the opaque `#object[java.time.X 0x.. \"ISO\"]` identity form. cljw makes both str and pr the toString; the value's `(str …)`, method results, and `=` all match clj."
0 commit comments