From: itsme213 Date: 2005-01-11T02:11:23+09:00 Subject: Re: Seeking info on keyword parameters "Michael Neumann" wrote > >>Why not use blocks that change what the current namespace is? > >> > >> namespace(:myns) { > >> x.send :move otherargs > >> ... > >> } > >> > >>That should be thread-local of course. Everything inside the block is > >>executed in the :myns namespace. > > > > > > This looks nice, but how would #send determine the current namespace? Would > > it need some form of dynamic binding of a thread-local variable > > current_namespace done in #namespace and corresponding dynamic lookup in > > #send? And what about x.move? > > It's not just #send. Any method call would need that information. Yes, > something like a thread-local would probably work. Maybe, the current > namespace should be stored in a special location on the stack... not > sure about that. I think dynamic binding of namespaces could lead to very bizarre behaviors, as you would on-the-fly replace entire sets of method invocations. Intriguing, but perhaps very dangerous?