Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Shoot, I totally overlooked that part. Here's the proper version:

  :load wordlist wordlist.txt
  =hasABC { all (count _ x == 1) "abc" }
  words wordlist | filter -:(len == 10 and hasABC and .8 == "k")
Notes:

{ } defines a lambda with parameters named x,y,z,a,b,c...

_ is the same as in noulith -- it turns any expression into a lambda. Values can also be omitted from most expressions (e.g. len == 10) for the same effect.

-: takes a lambda with n parameters and turns it into a lambda that takes 1 parameter and replicates it n times.



That is neat!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: