Skip to content

Commit 5478a0a

Browse files
committed
tests passing sorta???
1 parent 9bb9b44 commit 5478a0a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/clojure/dyna/rexpr.clj

+7-6
Original file line numberDiff line numberDiff line change
@@ -1512,18 +1512,19 @@
15121512
(let [seen (gensym 'seen)
15131513
cnt (gensym 'cnt)]
15141514
`(loop [~rvar ~rin
1515-
;~seen #{~rin}
1515+
;~seen #{~rin}
15161516
~cnt 0]
15171517
~(macrolet-expand
15181518
{'rexpr-rewrite-loop (fn [& args] `(rexpr-rewrite-loop ~@args))
15191519
'recur (fn [r] `(do
15201520
#_(when (or (contains? ~seen ~r) (> (count ~seen) 100))
1521-
(debug-repl "repeating rexpr rewrites"))
1521+
(debug-repl ~(str "repeating rexpr rewrites " r " " rvar)))
15221522
(when (> ~cnt 100)
15231523
(println "foo loop too many times")
1524-
#_(debug-repl "rewrite loop stuck"))
1524+
;(debug-repl "rewrite loop stuck")
1525+
)
15251526
(recur ~r
1526-
;(conj ~seen ~r)
1527+
;(conj ~seen ~r)
15271528
(inc ~cnt))))}
15281529
body)))))
15291530

@@ -1543,7 +1544,7 @@
15431544
nrif (debug-tbinding [current-top-level-rexpr nri]
15441545
(tbinding [simplify-with-inferences true]
15451546
(simplify-inference nri)))]
1546-
(if (not= nrif nri)
1547+
(if (and (not= nrif nri) (not= nrif cri))
15471548
(recur nrif)
15481549
nrif)))))
15491550

@@ -1570,7 +1571,7 @@
15701571
;; this function could be replaced with something that is smarter and chooses between multiple different options for what to guess about
15711572
true)]
15721573
(simplify-fast nri))]
1573-
(if (= nri nri2)
1574+
(if (or (= nri nri2) (= nri2 cri))
15741575
nri
15751576
(recur nri2))))
15761577
(catch UnificationFailure _ (make-multiplicity 0))))

test/dyna/benchmark_test.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
ctx
107107
(let [res (simplify-fully rexpr)]
108108
(is (= res (make-multiplicity 1)))
109-
(debug-repl)
109+
;(debug-repl)
110110
(is (= (ctx-get-value ctx (make-variable "result")) (f-closed-form to-value)))
111111
))))
112112

0 commit comments

Comments
 (0)