fd subsystem: instance? name-boundary + ~ reads as clojure.core/unquote
Two general fixes that clear core.logic's finite-domain -difference, safefd, and the defne quoted-list patterns (form->ast), taking the suite to 532/5/0. - instance? on a deftype matched a simple type name against the qualified tag by raw string suffix, so "a.b.MultiIntervalFD" tested true for IntervalFD. The suffix must land on a "." boundary. core.logic's fd dispatches on (interval? x) = (instance? IntervalFD x), and a MultiIntervalFD wrongly counted as an interval, so -difference/safefd computed the wrong set. - the reader reads ~ / ~@ as clojure.core/unquote(-splicing), like the JVM reader, instead of a bare unquote. Code that inspects quoted pattern/template data — core.logic's defne checks (= f 'clojure.core/unquote) — now sees the symbol it expects, so '(fn ~args . ~body) patterns compile. hc-head-is? accepts the qualified head in syntax-quote lowering; the value-preserving change leaves the minted seed byte-identical. corpus.edn: 2 JVM-certified unquote rows. unit.edn: two reader rows updated to the qualified unquote. make test + shakesmoke green, 0 new divergences, self-host holds.
This commit is contained in:
parent
42c163bacb
commit
f46772d576
5 changed files with 22 additions and 7 deletions
|
|
@ -323,8 +323,8 @@
|
|||
{:suite "reader" :expr "(= [1 [2 3] {:k :v}] (read-string \"[1 [2 3] {:k :v}]\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (quote x)) (read-string \"'x\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (clojure.core/deref a)) (read-string \"@a\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (syntax-quote (a (unquote b)))) (read-string \"`(a ~b)\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (unquote-splicing xs)) (read-string \"~@xs\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (syntax-quote (a (clojure.core/unquote b)))) (read-string \"`(a ~b)\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= (quote (clojure.core/unquote-splicing xs)) (read-string \"~@xs\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= 42 (read-string \"; comment\\n42\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(= [1 2] (read-string \"[1 #_ 9 2]\"))" :expected "true"}
|
||||
{:suite "reader" :expr "(nil? (read-string \"\"))" :expected "true"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue