From: Logan Capaldo Date: 2006-08-01T07:05:31+09:00 Subject: Re: I thought this was the one that worked? On Jul 31, 2006, at 5:13 PM, Chad Perrin wrote: > On Tue, Aug 01, 2006 at 04:57:48AM +0900, Logan Capaldo wrote: >> >> All these examples are lexical scoping. Ruby doesn't really have >> dynamic scoping although you can sort of abuse instance variables to >> achieve similar effects. >> >> The difference is that blocks are closures, where def, class, and >> module aren't. > > Wait . . . you mean that *all blocks* are automagically lexical > closures, as though declared lexical variables within them have > gone out > of scope? I imagine I'm probably misunderstanding you, but if not, > that's a pretty nifty bit of trickery. > I'm not sure I understand your question. All blocks (by blocks I mean do / end and { } ) are (lexically scoped) closures. > -- > CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] > Ben Franklin: "As we enjoy great Advantages from the Inventions of > others we should be glad of an Opportunity to serve others by any > Invention of ours, and this we should do freely and generously." >