On Mon, Oct 8, 2012 at 12:23 AM, Cody Koeninger <
co...@koeninger.org> wrote:
> Closest thing to clojure's some is probably find, but in this case I
> think you only need exists.
That's what I was looking for. So much better:
def tweetMatchesAnyKeyword(keywords: List[String], tweet: Tweet) : Boolean =
keywords.exists(tweet.text.contains(_))
> I personally don't think currying looks very idiomatic in scala, but
> maybe that's just me.
I haven't used a language with that kind of syntax, so it's hard to
say. It was certainly very easy to write that, but to compare again
to Clojure, I'd write out the function completely and use either
partial application to produce the curried function or the function
literal, like in the scala above. (I assume that's what it is called
at least) Of course, if there the first curried argument needed
processing of some sort that didn't need to happen on every
invocation, I'd write it out as a function generator.
I wonder what's up for this week.