From: Ilias Lazaridis Date: 2005-04-04T00:29:42+09:00 Subject: Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby Saynatkari wrote: > Le 3/4/2005, "Ilias Lazaridis" a �crit: >>Ilias Lazaridis wrote: [...] >>>I need to fill in the interactive session, to close this thread: >>> >>>http://lazaridis.com/case/lang/index.html#run_interactive >>> >>>http://lazaridis.com/case/lang/ruby.html#run_interactive >> >>I've tried this: >> >>open command window >>change to project directory >>cmd: irb >>within irb >>cmd: require 'talker' >> >>talker is created, produces output. >> >>but: the "talker" instance which was created during read in (of >>talker.rb) has died. >> >>why? > > Local variables evaluated during a require() are not accessible > from outside the file; you may consider this such that the file > is the scope within which the variable is defined, just like in > a method body. I understand. instead of 'require', can I use another command, like e.g. "expand". >>how do i read-in files, which produce instances, which 'survive'? > > Global variables (although this practice would be discouraged), > which are identified by a $-prefix, e.g. $global = 'something'. > Come to think of it, constants may also be accessible. ok > Normally one will have either an accessor method of some sort > or simply provide the means of _creating_ an instance. > >>and: how do I delete an instance? [tried: del, delete, kill, rm, free] > > One cannot explicitly delete an instance. It will be 'deleted' > (marked for garbage collection) once it is without references. how can i reverse the process? I like to kill the object, thus the destructor is called. the references will point to nil. .. -- http://lazaridis.com