From: Robert Klemme Date: 2003-02-17T20:24:51+09:00 Subject: Re: Lexical scope and closures I see. Thanks! robert "Mauricio Fern�ndez" schrieb im Newsbeitrag news:20030217094102.GA13990@student.ei.uni-stuttgart.de... > On Mon, Feb 17, 2003 at 06:04:30PM +0900, Robert Klemme wrote: > > > > > > 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! > > That mechanism can be implemented in Ruby itself, ie. it doesn't need > the parser to be modified. Almost all the other possibilities involve > new keywords or syntax. > > def local; yield; end > > local do |islocal,istoo| > islocal = true > istoo = bla > end > > # both islocal and istoo undefined here. > > -- > _ _ > | |__ __ _| |_ ___ _ __ ___ __ _ _ __ > | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ > | |_) | (_| | |_\__ \ | | | | | (_| | | | | > |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| > Running Debian GNU/Linux Sid (unstable) > batsman dot geo at yahoo dot com > > need help: my first packet to my provider gets lost :-( > sel: dont send the first one, start with #2 > * netgod is kidding >