Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
swannodette
on March 1, 2013
|
parent
|
context
|
favorite
| on:
Clojure 1.5
One my favorite features that came out of reducers - short circuiting reduce!
(reduce (fn [a b] (if (> a 100) (reduced a) (+ a b))) (range 100000)) => 105
I've often had to use loop/recur instead of reduce because you could not short circuit. No longer.
invalidOrTaken
on March 2, 2013
|
next
[–]
YES, I was hunting around for this in 1.4, happy to see it's arrived.
malkia
on March 1, 2013
|
prev
|
next
[–]
This is so beautiful, like recur's blessing in disguise.
k0t0n0
on March 2, 2013
|
prev
[–]
cool
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: