From: "David A. Black" Date: 2003-12-10T02:39:37+09:00 Subject: Re: Adjusting the Scope of Blocks Hi -- On Wed, 10 Dec 2003, Robert Klemme wrote: > > "Dan Doel" schrieb im Newsbeitrag > news:3FD5F0F8.3030500@po.cwru.edu... > > > > >I had never noticed that closures behave this way when > > >instance_eval'd. My initial reaction is dislike. To me it feels too > > >close to having the code in the block interpreted as an eval string. > > > > > >... > > > > > > > > >It feels non-closure-like to me. I don't see why a block should care > > >what 'self' is at the time it's called; I thought the point was for it > > >to preserve the context of its creation. > > Well, is a special kind of closure; a closure that allows through internal > magic that self is temporarily bound to something other than at creation > time (dunny a term for this though). From a theoretical point of view it > might be spooky, but it comes in handy from time to time if you need to > invoke several methods of an instance. Yikes -- spooky magic. Sounds worse and worse :-) You're describing it accurately, but my point is not that I don't see what it's doing but that I don't like what it's doing. (See my response to Dan.) I wonder whether the saving grace of this might be the & character. That does at least give a visual cue. But the idea of a closure becoming "special" based on how it's treated somewhere else in the program doesn't do much for me at this point. David -- David A. Black dblack@wobblini.net