fn literals are not allowed as predicates in catch
Closed this issue · 4 comments
In a catch expression, fn literals appear to not be allowed:
Simple test case:
(try+
(throw+ {:foo true})
(catch #(-> % :foo (= false)) data
(println "caught")))
Replace #(-> % :foo (= false))
with a named fn, and you get the expected behavior.
Does it work if you leave out the #?
On Feb 24, 2012, at 11:40 PM, Allen Rohnerreply@reply.github.com wrote:
In a catch expression, fn literals appear to not be allowed:
Simple test case:
(try+ (throw+ {:foo true}) (catch #(-> % :foo (= false)) data (println "caught")))Replace `#(-> % :foo (= false)) with a named fn, and you get the expected behavior.
Reply to this email directly or view it on GitHub:
#20
Yes, everything works as expected without the #. I didn't think to try that because the docs ask for a "predicate", which I interpreted to mean as an actual IFn rather than an expression.
Thanks for the report! It's fixed in slingshot 0.10.2.
Thanks for the quick response!