Higher-order messaging in Ruby

Higher-order messaging in Ruby

Post by Victor "Zv » Fri, 13 Oct 2006 02:37:49


Hi all.

Jus stumbled upon interesting post here:
http://www.yqcomputer.com/

One more trick allowing goodies like

[0,1,2,3,4].where.nonzero?
# => [1,2,3,4]

[0,1,2,3,4].do_collect * 2
# => [0,2,4,6,8]

And so on.
Wow, IMHO.

V.