From: dblack@... Date: 2003-02-16T22:35:10+09:00 Subject: Re: Lexical scope and closures Hi -- On Sun, 16 Feb 2003, ts wrote: > >>>>> "d" == dblack writes: > > d> def meth > d> a = 1 > d> [1,2,3].each {|x| # explicitly import existing a into block} > d> end > > I don't understand sorry, with this example > > a = 1 > 1.times do |x| > a = 2 # shadowing ???? > end > a # ===> 1 > > a = 1 > 1.times do |x| > # explicitly import existing a into block > a = 2 > end > a # ===> 2 > > this ? Yes, but now that I see the word "shadowing" I realize it won't happen :-) I'm just trying to find something to suggest instead of "local" or "let", without much success. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav