4 ms·
I sent you a pull request. I think the Clojure version becomes more performant still if you slurp the nouns into a set so you don't have to do a linear traversa
by rboyd 14y ago
I sent you a pull request. I think the Clojure version becomes more performant still if you slurp the nouns into a set so you don't have to do a linear traversal.
Also, I think the regex usage makes the code a little harder to digest and comes at the cost of further unnecessary cycles.
I think this code gets even easier if you don't have to preserve the whitespace and filter non-alpha characters. (see danneu's suggestions)
Finally, what are your thoughts on passing along the wordlist (nouns) as an arg to nurble? This would offer referential transparency and also make the test easier.
Btw, I think your update broke your gist (where you changed (some (partial = w) nouns) to (not (some (partial = w) nouns)). Check that out again.
Cool post, thanks for sharing.