From: badboy Date: 2009-01-14T04:29:27+09:00 Subject: Re: Implementing each and <=> Ruby Rabbit schrieb: > badboy wrote: >> Ruby Rabbit schrieb: >>> (let's just assume that @list is an array) >>> >>> Thanks. >> i would define each like this: >> def each(&blk) >> @list.each(&blk) >> end > > okay, i forgot to mention that I was wondering whether the > easiest/cleanest way was to use a send somehow? > > def each > @list.send > end > > Actually, since the ruby source is in 'C' one can't check it to see > examples. I searched a lot but came up with nothing. > > Thanks. I don't think that using send is easier/cleaner using @list.each(&blk) is nothing else than sending the message "each" to @list with blk as a block parameter