From: "trans. (T. Onoma)" Date: 2004-09-20T23:21:19+09:00 Subject: Re: Array#index block and rdetect On Monday 20 September 2004 10:04 am, Robert Klemme wrote: > I'd say rather > > i=-1 > enumobj.each {|a| i+=1; ... } > > Reason: scoping rules: > >> %w{aa bb cc}.each {|a| i=(i||-1)+1; p [a,i]} > > ["aa", 0] > ["bb", 0] > ["cc", 0] > => ["aa", "bb", "cc"] Huh. That's telling. Oh well, I was just trying to keep i local to the block is all. -- ( o _ カラチ // trans. / \ transami@runbox.com I don't give a damn for a man that can only spell a word one way. -Mark Twain