From: Brett Simmers Date: 2007-07-24T07:55:45+09:00 Subject: Re: Newbie Question: irb --------------080705020908050102040707 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit In irb, "_" represents the previous result, and to go farther back you can just assign results to variables. irb(main):001:0> a = 1 + 2 => 3 irb(main):002:0> 5 => 5 irb(main):003:0> _ + a => 8 Mike Halloran wrote: > How can I access the previous result of an evaluation in the irb > debugger. > > For example: > > >>> 1 + 2 >>> > 3 <-- I want to access this result > > >>> 5 + {some expression which is '3'} >>> > 8 > > > ================= > In lisp it would be: > > >>> (+ 1 2) >>> > 3 > >>> (+ 5 *) <-- use a star to grab one result back >>> > 8 > >>> (+ 5 **) <-- use a double start to grab two results back >>> > 8 > > Anyway, thanks in advance for the help, > > Mike > --------------080705020908050102040707--