From: Mike Gold Date: 2008-10-02T05:54:57+09:00 Subject: Re: ruby1.9 block scope Pit Capitain wrote: > So Mike, please show us a real non-contrived example to enlighten us. > I've often used Class.new but still don't see your problem. Do you understand my previous paragraph: By contrast, it would be convoluted to create all new scopes each with instance variables pointing back to the places I just came from. The code would be Java-like: reams of scaffolding which serve no end except to compensate for a missing language feature. I ask because I've seen no indication that others have gotten it besides matz. A larger example would be just what I've written already, only larger. But if we aren't first on the same page with respect to the above, the larger example will not help either. There is nothing I'm holding back. If it's not obvious then ask a question. I would suggest to actively seek what is meant by the above, rather than to passively demand code which will infuse you with enlightenment. It won't. Rather, treat it as a homework problem: construct a case where a set of dynamically generated _unique_ classes bound to the current context results in better code compared to a set of named classes defined in a different scopes containing instance variables to that current context. Go. I don't mean to lecture, but after the necessary tools have been laid on the table, I do resent students who demand to be shown. It is only the curious who really learn. Questions are welcome. Demands are not. > You have to do that in current Ruby, too, because you have to check > for local variables that have been assigned to before the code blocks. But you don't have to check for locals that have been assigned after. See my example. -- Posted via http://www.ruby-forum.com/.