News for hackers. Stuff that matters.
Re:Why Learning Haskell/Python Makes You a Worse Programmer by lsb on Wednesday December 24, 2008 @12:29PM (#408965)
Using Symbol#to_proc, the old Ruby

  myList.collect { |f| f.description }.select { |d| d != "" }.join("\n")
becomes

  myList.map(&:description).reject(&:empty?).join("\n")
which is even more direct: take my list, map each element to its description, reject anything empty, and join with newlines.
Re:Why Learning Haskell/Python Makes You a Worse Programmer by d0mine on Wednesday December 24, 2008 @06:21PM (#409230)
I thought `Symbol#to_proc` is a Rails' extension.
Re:Why Learning Haskell/Python Makes You a Worse Programmer by lsb on Wednesday December 24, 2008 @11:38PM (#409409)
I learned about it in 2005, when I read it on http://pragdave.pragprog.com/pragdave/2005/11/symbolto_proc.... and it's such a good idea that they've folded it into 1.9 http://www.infoq.com/news/2008/02/to_proc-currying-ruby19