From: Austin Ziegler Date: 2002-12-11T08:38:12+09:00 Subject: Re: Seeking Ruby Samadhi First, here's a piece of working code that prints the values "1 2 3" as one would expect: class Array def each2 each {|value| puts value} end end [1, 2, 3].each2 **HOW IN THE NAME OF ALAN TURING DOES _each2_ PASS _value_ TO _each_***?!?! -------------- It doesn't. each2 is passing {|value| puts value} to each. The declaration of each is *like*: def each(&block) ...iteration block... block.call(item) ...end iteration... end Values are passed to blocks with either "yield item" or "block.call(item)". -a