It calls ‘inspect’ on the result of an expression and displays it. You can
instruct irb to use to_s instead, for instance with command line
option --noinspect.
Gennady.
···
----- Original Message -----
From: “Daniel Carrera” dcarrera@math.umd.edu
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Thursday, February 06, 2003 2:07 PM
Subject: What does IRB’s “=>” show?
I don’t quite understand what irb’s “=>” is showing. In particular, I’d
like to
know how to change it.
Currently I get:
p = X**2 - 1
=> #<Math::Polynomial::Poly:0x1a4c48 @coeffs=[-1, 0, 1]>
And I’d rather it produce something like:
p = X2 - 1
=> X2 - 1
Or better yet:
p = X**2 - 1
=>
2
X - 1
Is this possible?
–
Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137