From: dblack@... Date: 2006-10-10T18:15:22+09:00 Subject: Re: || explanation in ruby... in pseudolanguage Hi -- On Tue, 10 Oct 2006, Tom Armitage wrote: >> Anyway, if it helps, I tend to think of the |var| notation as "with", e.g. >> >> some_list.each do |item| ... end >> >> becomes (at least in my head) some_list each do with item ... > > Interesting - I tend to think of it as "as", which doesn't > transliterate as well, but indicates that the object inside the pipes > is temporary; it's just a name we're giving the iterated objects. Possibly... item = 1 [2,3,4].each do |item| end p item # 4 David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org