From: Wojciech Kaczmarek Date: 2003-02-28T06:01:31+09:00 Subject: 'each' returning array A newbie problem: Is there a way to transparently accumulate expresions evaluated within a block into an array, without introducing an external variable? For example, I'd like to write something like this: "HAL".each_byte__returning_array {|x| (x+1).chr} .collect # more processing ...instead of this: l=[]; "HAL".each_byte {|x| l<< (x+1).chr}; l.collect #... One of my first impressions with ruby was the surprise that each* method family doesn't return such accumulated arrays just for method chaining. Am I thinking totally non-rubyish? ;-) If so, please show me the Right Way.. -- He who foos last foos best