From: David Corbin Date: 2002-03-18T23:30:23+09:00 Subject: Re: eval/Module question (clearer) I understand what you're saying, but I want the code being eval to be considered as if it were complete. I don't think the way I structure my code should affect the way my data is written (what's being evaled is my data, not my code), and that's what this does. Someone else pointed out the binding argument, which I will play with. Chris Morris wrote: >>Seems to me there is a weakness in the language here.... >> > >I don't agree. What it seems you're asking for is the ability to execute >code and not have it obey the expected scope. > >If I wrote this: > > module Test > eval 'def MyMethod; puts 'hey'; end' > end > >... and it became this: > > module Test > end > > def MyMethod > puts 'hey' > end > >... I'd say this was unexpected. How could I then make sure MyMethod made it >into module Test? To be consistent, IMO, eval code should be the equivalent >to 'hardcoded' code, right? > >Obviously, that still leaves you with your problem ... Ron's solution is one >way out -- don't know if there's another. > >Chris > > > > >