From: David Marchaland Date: 2010-02-10T06:40:13+09:00 Subject: Re: Reset the whole state Hi Remi, I have the same approach that you describe in your post regarding embedded Ruby interpreter. I did some trial based on dl library in C to dynamically open and close Ruby interpreter but I had some issue due to dlclose() behavior when a so library is loaded into Ruby. Do you find any solution to restart your Ruby interpreter? Thanks, David Remi Gillig wrote: > On Jun 13, 6:09 pm, Robert Klemme wrote: >> > Each of these talk about how to reset the whole Ruby state, like >> > # h = $hello.new >> creating a process isn't that expensive. >> >> Having said that, maybe you can look at how Ruby can be embedded in C >> programs. Then you could create a new initial context if something like >> that exists. >> >> Cheers >> >> robert > > It's actually embedding that I'm using right now. I am using Ruby as a > script language for a code editor to perform operations on text etc. > There is a script which is loaded when the program loads which > contains > some classes defined by the user for example. I would like to be able > to > reload this script without having warnings about constants, having > classes mixed together if the user changed the name of a function > between the loadings or still having the same global variables. > > Remi Gillig. -- Posted via http://www.ruby-forum.com/.