News for hackers. Stuff that matters.

ricardo_

Re:CoffeeScript One Liners on Thursday June 02, 2011 @06:24AM (#2611366)
IMO expressiveness has to do with being close to natural language: "multiply number by 2 for every number in 1 to 10". "map" is CS vocabulary.

The conditional could be placed outside the string and still be a one-liner. It's there mostly for "flow".

Re:Scala One Liners on Thursday June 02, 2011 @05:15AM (#2611250)
looks like I'm late to the party.. I rewrote most of them in CoffeeScript: http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-I...

I'm specially fond of

    "Happy Birthday #{if i is 3 then "dear Robert" else "to You"}" for i in [1..4]