From: Robert Klemme Date: 2003-02-17T18:04:30+09:00 Subject: Re: Lexical scope and closures schrieb im Newsbeitrag news:200302141518.h1EFI0804442@sharui.nakada.kanuma.tochigi.jp... > Hi, > > At Fri, 14 Feb 2003 22:32:11 +0900, > Robert Klemme wrote: > > > > > I'd choose something between > > > > > > > > > > arr.each {|i| > > > > > local{|a,b| > > > > > c = .. > > > > > ... > > > > > } > > > > > } > > > (snip) > > > > > in either case, a, b are local, c is method-wise variable. > > > > > > > > I vote for the second variant, possibly replacing 'let' with 'local'. The > > > > drawback of the first variant is IMHO that it is too easily recognized as > > > > an ordinary block. > > > > > > Because it is an ordinary block. > > > > ? Why would you then need a 'local' keyword at all? > > def local; yield; end Err, sorry, I don't get what you mean. Could you please write another explaining sentence? Thanks a lot! Regards robert