nathanmarz/cascalog — Issue #49: find-first
Author: eightysteele
Created: 2012-01-27 05:48:12+00:00
State: open

Hey Guys,

I was working through Nathan's Cascalog tutorial and ran into an example that used `find-first` which didn't run since it's not in Clojure 1.3:

```clojure
(defn agebucket [age]
(find-first (partial <= age) [17 25 35 45 55 65 100 200]))

(?<- (stdout) [?bucket ?gender ?count]
(age ?person ?age) (gender ?person ?gender)
(agebucket ?age :> ?bucket) (c/count ?count))
```

Here's the tutorial:

http://nathanmarz.com/blog/introducing-cascalog-a-clojure-based-query-language-for-hado.html

Updating that post with something like `(first (filter pred coll)))` would be excellent!

Also related, I found a couple of references to `find-fist` in the the Cascalog code:

https://github.com/nathanmarz/cascalog/blob/master/src/clj/cascalog/rules.clj#L95
https://github.com/nathanmarz/cascalog/blob/master/src/clj/cascalog/rules.clj#L322

Thanks!
Aaron