We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While looking at #69, I decided to add some tests to make sure any changes I made did not affect walk order.
To refresh my brain on pre-walk and post-walk traversal, I read:
Rewrite-clj's prewalk travesal seems to match the above descriptions, but postwalk traversal seems off.
(defn- walk-order-tester [walk-fn s] (let [zloc (base/of-string s) visits (atom [])] (walk-fn zloc (fn [zloc] (swap! visits conj (base/string zloc)) zloc)) @visits)) ;; prewalk looks good: (walk-order-tester w/prewalk "(1 (2 3 (4 5) 6 (7 8)) 9)") ;; => ["(1 (2 3 (4 5) 6 (7 8)) 9)" ;; "1" ;; "(2 3 (4 5) 6 (7 8))" ;; "2" ;; "3" ;; "(4 5)" ;; "4" ;; "5" ;; "6" ;; "(7 8)" ;; "7" ;; "8" ;; "9"] ;; but postwalk looks wrong (walk-order-tester w/postwalk "(1 (2 3 (4 5) 6 (7 8)) 9)") ;; => ["9" ;; "8" ;; "7" ;; "(7 8)" ;; "6" ;; "5" ;; "4" ;; "(4 5)" ;; "3" ;; "2" ;; "(2 3 (4 5) 6 (7 8))" ;; "1" ;; "(1 (2 3 (4 5) 6 (7 8)) 9)"]
For postwalk, I would have expected:
["1" "2" "3" "4" "5" "(4 5)" "6" "7" "8" "(7 8)" "(2 3 (4 5) 6 (7 8))" "9" "(1 (2 3 (4 5) 6 (7 8)) 9)"]
The text was updated successfully, but these errors were encountered:
b6ec3c6
No branches or pull requests
While looking at #69, I decided to add some tests to make sure any changes I made did not affect walk order.
To refresh my brain on pre-walk and post-walk traversal, I read:
Rewrite-clj's prewalk travesal seems to match the above descriptions, but postwalk traversal seems off.
For postwalk, I would have expected:
The text was updated successfully, but these errors were encountered: