I would like a way to eval code on to a Namespace object. Could we add an eval method that doesn't take a binding object? Writing a new file every time I want to test Namespaces is too cumbersome.
Why instance_eval? The distinction between eval/class_eval/instance_eval does not seem relevant here.
Though of course the semantics should be the same as writing the code to a file + Namespace#require so e.g. ns.eval "def foo = 42" defines method foo on ns' copy of Object methods.
@Eregon (Benoit Daloze) I feel like that's more consistent with the rest of the language. I can't remember if any object as a eval method. But evaluating some code in a particular instance context makes me think of instance_eval.
@Eregon (Benoit Daloze) I feel like that's more consistent with the rest of the language. I can't remember if any object as a eval method. But evaluating some code in a particular instance context makes me think of instance_eval.