> On Nov 16, 2016, at 14:32, Die Optimisten <inform / die-optimisten.net> wrote:
> 
> I have some vars (with important contents) in irb, because I need to access these, I tried some test-code in the same session, polluting it with new vars. Now I have so many vars, I should remove the unused, to find the important ones...

You can use subsessions in irb:

3559 % irb
>> x = 42
=> 42
>> irb
>> puts x
NameError: undefined local variable or method `x' for main:Object
	from (irb#1):1
>> y = 24
=> 24
>> puts y
24
=> nil
>> jobs
=> #0->irb on main (#<Thread:0x007fc9e10bc8b0>: stop)
#1->irb#1 on main (#<Thread:0x007fc9e20347e8>: running)
>> fg 0
=> #<IRB::Irb: @context=#<IRB::Context:0x007fc9e182f7a0>, @signal_status=:IN_EVAL, @scanner=#<RubyLex:0x007fc9e184c0a8>>
>> puts y
NameError: undefined local variable or method `y' for main:Object
	from (irb):3
	from /usr/bin/irb:12:in `<main>'
>> 


Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>