Commit 5478a0a 1 parent 9bb9b44 commit 5478a0a Copy full SHA for 5478a0a
File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 1512
1512
(let [seen (gensym 'seen)
1513
1513
cnt (gensym 'cnt)]
1514
1514
`(loop [~rvar ~rin
1515
- ; ~seen #{~rin}
1515
+ ; ~seen #{~rin}
1516
1516
~cnt 0 ]
1517
1517
~(macrolet-expand
1518
1518
{'rexpr-rewrite-loop (fn [& args] `(rexpr-rewrite-loop ~@args))
1519
1519
'recur (fn [r] `(do
1520
1520
#_(when (or (contains? ~seen ~r) (> (count ~seen) 100 ))
1521
- (debug-repl " repeating rexpr rewrites" ))
1521
+ (debug-repl ~( str " repeating rexpr rewrites " r " " rvar) ))
1522
1522
(when (> ~cnt 100 )
1523
1523
(println " foo loop too many times" )
1524
- #_(debug-repl " rewrite loop stuck" ))
1524
+ ; (debug-repl "rewrite loop stuck")
1525
+ )
1525
1526
(recur ~r
1526
- ; (conj ~seen ~r)
1527
+ ; (conj ~seen ~r)
1527
1528
(inc ~cnt))))}
1528
1529
body)))))
1529
1530
1543
1544
nrif (debug-tbinding [current-top-level-rexpr nri]
1544
1545
(tbinding [simplify-with-inferences true ]
1545
1546
(simplify-inference nri)))]
1546
- (if (not= nrif nri)
1547
+ (if (and ( not= nrif nri) ( not= nrif cri) )
1547
1548
(recur nrif)
1548
1549
nrif)))))
1549
1550
1570
1571
; ; this function could be replaced with something that is smarter and chooses between multiple different options for what to guess about
1571
1572
true )]
1572
1573
(simplify-fast nri))]
1573
- (if (= nri nri2)
1574
+ (if (or ( = nri nri2) ( = nri2 cri) )
1574
1575
nri
1575
1576
(recur nri2))))
1576
1577
(catch UnificationFailure _ (make-multiplicity 0 ))))
Original file line number Diff line number Diff line change 106
106
ctx
107
107
(let [res (simplify-fully rexpr)]
108
108
(is (= res (make-multiplicity 1 )))
109
- (debug-repl )
109
+ ; (debug-repl)
110
110
(is (= (ctx-get-value ctx (make-variable " result" )) (f-closed-form to-value)))
111
111
))))
112
112
You can’t perform that action at this time.
0 commit comments