On Fri, Feb 14, 2003 at 12:03:59PM +0900, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Lexical scope and closures" > on 03/02/14, Tom Sawyer <transami / transami.net> writes: > > |more suitable would be the changes as you have already suggested plus the > |addition of local keyword. ( i.e. arr.each local do ... end ) > > I'd choose something between > > arr.each {|i| > local{|a,b| > c = .. > ... > } > } personal feeling: too many indentation levels. > and > > arr.each {|i| > let a = .. > let b = .. > c = .. > ... > } > > in either case, a, b are local, c is method-wise variable. Would you reconsider dropping ':=' ? arr.each { |i| a := .. b := .. c = .. ... } involves fewer keystrokes. Moreover (I don't know if it was your original idea or not, but just to be sure) a = 1 arr.each { |i| a := .. ... a = .. # uses local a, not external, ie. := works like let } -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Yes I have a Machintosh, please don't scream at me. -- Larry Blumette on linux-kernel