Feature Requests: Browse | Submit New | Admin

[#19635] add _ as the return value of the last eval'ed line

Date:
2008-04-18 18:57
Priority:
3
Submitted By:
Roger Pack (rogerdpack)
Assigned To:
Nobody (None)
Category:
Interface Improvements (example)
State:
Open
Summary:
add _ as the return value of the last eval'ed line

Detailed description
It would be nice if, with autoeval set, one could do as irb does for 'grabbing' return values
(rdb:1)a = 3
(rdb:1)_
3

[currently errs]
Would make debugging just barely faster, I believe :)

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-05-20 21:46
Sender: Roger Pack

looks like irb does it thus:

[158, 167] in
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ru
by/1.8/irb/context.rb
   158      end
   159  
   160      attr_reader :last_value
   161  
   162      def set_last_value(value)
=> 163        @last_value = value
   164        @workspace.evaluate self, "_ =
IRB.CurrentContext.last_value"
   165      end

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item