lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Sat, Dec 5, 2009 at 7:41 PM, Mark Hamburg <mark@grubmah.com> wrote:
Thus in a Unix-ish fashion we could write:

       numbers | filter( odd ) | map( square )


In English: Take the numbers, take the odd ones from that, and then square them.
 
Rather than:

       map( square )( filter( odd ) ( numbers ) )


In English: Squared odd numbers.

I know which I prefer ;-)

This is, I guess, the difference between imperative and declarative, if you like. And yes, there's still noise like map and filter, and if you want to get rid of that as well, use J.

Robby