Match outer forms first - from Kevin's issue #23
This commit is contained in:
parent
4963421cff
commit
9cec3ee154
2 changed files with 2 additions and 1 deletions
|
@ -42,6 +42,7 @@ Bugs can be reported using the github bug tracker.
|
||||||
* Phil Hagelberg
|
* Phil Hagelberg
|
||||||
* Alan Malloy
|
* Alan Malloy
|
||||||
* Paul deGrandis
|
* Paul deGrandis
|
||||||
|
* Kevin Lynagh
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
;; Simplifies expr according to the rules until no more rules apply.
|
;; Simplifies expr according to the rules until no more rules apply.
|
||||||
(defn simplify [expr rules]
|
(defn simplify [expr rules]
|
||||||
(->> expr
|
(->> expr
|
||||||
(iterate (partial walk/postwalk #(simplify-one % rules)))
|
(iterate (partial walk/prewalk #(simplify-one % rules)))
|
||||||
(partition 2 1)
|
(partition 2 1)
|
||||||
(drop-while #(apply not= %))
|
(drop-while #(apply not= %))
|
||||||
(ffirst)))
|
(ffirst)))
|
||||||
|
|
Loading…
Reference in a new issue