From: wys@... (Clemens Wyss) Date: 2001-02-26T18:18:15+09:00 Subject: [ruby-talk:11579] clone'ing a binding (context) Hi, I hoped to really get a deep-copy of a binding context when cloning it. But as the following example shows that this is not the case: if (!Module.respond_to?(:test)) then print "as expected\n" end context = (Object.module_eval ("binding")).clone() eval('class Module; def test(); end; end;', context) if (Module.respond_to?(:test)) then print "hmmm, why this?" end I would like to allow class/module-modifications in the eval command but this should not affect the main-context! On the other hand I need the "Object.module_eval("binding")-context in order to also let the user extend classes like Module/Class/Object (as proposed by David Alan Black in his post from yesterday ("Re: eval-context problem(bug?)")) Am I expecting something impossible? Is there some kind of "real deep-copy"? Regards Clemens