Chez parity: trailing-apostrophe symbols + arglist return hints (jolt-vgrp, jolt-5540)
Two Chez reader bugs, both JVM-parity gaps: inc'/+'/foo' (trailing apostrophe) were mis-read as a symbol followed by a quote macro, because the reader treated ' as a terminator. In Clojure ' is a NON-terminating macro char (constituent after the first char). Since the seed is minted on Chez, (def inc' inc) became (def inc 'inc), clobbering inc's var cell with its own symbol -- so (var-get (var inc)) returned the symbol, not the fn. Drop ' from the token terminator set; a leading ' still quotes. ^bytes [b] / ^String [x y] return-type hints: the Chez reader lowered ^meta on a collection to a (with-meta vec meta) form, but emitted a QUALIFIED clojure.core/with-meta while the Janet reader emits a bare with-meta -- so the fn/defn macros' unwrap logic (matching the bare head) slipped past it and choked on a non-vector arglist. Emit bare with-meta to match Janet, and unwrap a (with-meta <vec> _) arglist in analyze-fn as a backstop. Re-minted the seed. zero-janet 2699, prelude 2652, Janet gate 155/0, fixpoint 10/10, bootstrap 6/6, all 0 new divergences.
This commit is contained in:
parent
53a189541c
commit
eb1c3298a4
5 changed files with 53 additions and 25 deletions
File diff suppressed because one or more lines are too long
|
|
@ -495,15 +495,15 @@
|
|||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "ifn?" (letrec ((ifn? (lambda (x) (let fnrec882 ((x x)) (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "fn?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "keyword?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "symbol?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "map?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "set?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (let* ((or__14__auto (jolt-invoke (var-deref "clojure.core" "vector?") x))) (if (jolt-truthy? or__14__auto) or__14__auto (jolt-invoke (var-deref "clojure.core" "var?") x))))))))))))))))) ifn?)))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "+" (jolt-symbol #f "+")))
|
||||
(def-var! "clojure.core" "+'" jolt-add))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "-" (jolt-symbol #f "-")))
|
||||
(def-var! "clojure.core" "-'" jolt-sub))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "*" (jolt-symbol #f "*")))
|
||||
(def-var! "clojure.core" "*'" jolt-mul))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "inc" (jolt-symbol #f "inc")))
|
||||
(def-var! "clojure.core" "inc'" jolt-inc))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "dec" (jolt-symbol #f "dec")))
|
||||
(def-var! "clojure.core" "dec'" jolt-dec))
|
||||
(guard (e (#t #f))
|
||||
(def-var! "clojure.core" "unchecked-add" (letrec ((unchecked-add (lambda (x y) (let fnrec883 ((x x) (y y)) (+ x y))))) unchecked-add)))
|
||||
(guard (e (#t #f))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue