From: Pit Capitain Date: 2008-10-02T15:16:02+09:00 Subject: Re: ruby1.9 block scope 2008/10/1 Mike Gold : > 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. Why should I do that? You said that changing Ruby to automatically expand the scope of local variables would make some code harder to visually inspect and showed an example using Class.new and define_method. But your example could be changed easily to use normal class and method definitions without altering its behaviour. My question is why you need the current context. This is the very part which you don't explain in your example. I'm not asking "how" but "why". By writing code I can only learn about the "how" part. I'm always interested to learn something new, but if you don't want to answer the question, that's fine for me, too. >> 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. Oh really? I think I didn't get this, yet :-) But how does this change the asymptotic complexity? This is what I wrote about. Regards, Pit