From: Trans Date: 2005-07-31T07:06:02+09:00 Subject: Re: make local var visible David A. Black wrote: > It's fragile because it means you're coupling things that are in > different scopes. You might, for example, want to refactor part of > your program (put a class definition in another file, or whatever), > and you'd have to keep track of these "local" variables because > someone, somewhere, might have used your "local" variable in another > scope with ::var or whatever. True. But wouldn't you be facing the same thing by using Const, $var, or @@var? Nonethless you make it clear that good coding practices, like SOC, is the way to go. > Keep in mind that with Class#new, class_eval, define_method, closures, > and other such tools, you can do a fair amount of scope-capturing > already. I think part of the point of the class and def keywords is > to seal off the scope of local variables. And thus enforcing good coding practices? T.