From: "Mauricio Fernández" Date: 2003-02-15T08:13:56+09:00 Subject: Re: Lexical scope and closures On Sat, Feb 15, 2003 at 04:41:52AM +0900, Tom Sawyer wrote: > On Friday 14 February 2003 08:18 am, nobu.nokada@softhome.net wrote: > > > > ? Why would you then need a 'local' keyword at all? > > > > def local; yield; end > > all it does local a and b. ugly, if you ask me. > > hey, i thought of another ugly possibility yesterday! :-) > > arr.each { |i| > c = "is local" > @c = "is c in outer scope" > @@c = "is @c in outerscope" > @@@c = "is @@c in outerscope" > } > > yep, and then you can layers and layers of blocks and eventually end up with: > > @@@@@@@@@@@@@@@c = "foo bar" > > fun fun ;-) Still dreaming of your super-closures? :) The other notation was more elegant... FWIW, I find local at the same time 1) ugly, cause it involves another indentation level and lots of key-presses 2) beautiful, cause it's defined in the language itself and not by modifying the parser At the end of the day, (1) is the most important since I won't be admiring (2) when I have to type it for the 1000th time. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com I've no idea when Linus is going to release 2.0.24, but if he takes too long Im going to release a 2.0.24unoff and he can sound off all he likes. -- Alan Cox