You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
👋 Using >defn on a recursive definition yields a Clojure compiler error.
(>defn walk
[s u]
(if-let [[_ v] (find s u)]
(recur s v)
u))
1. Caused by java.lang.UnsupportedOperationException
Can only recur from tail position
The macro-expanded code looks a little something like this, which explains the above error:
(defnwalk
[s u]
...inputchecking...
(let [output (do ... body ...)]
... output checking ...
output))
Would it be possible to rewrite the macro to make sure that the user's code remains in tail-position?
Perhaps by moving the output checking to a :post assertion?