Jian Lin wrote:

> require 'pp' works until inspect is redefined, then it will stop working 
> and give the following error.  thanks for giving out starting pointers 
> though.

on the other hand, if inspect() is to return a string representation, 
then 'pp' still works except it doesn't print out all the instance 
variables:

irb(main):026:0> class Point
irb(main):027:1>   def inspect
irb(main):028:2>     "#@x #@y and i am a point"
irb(main):029:2>   end
irb(main):030:1> end
=> nil
irb(main):031:0> p
=> 1 2 and i am a point

irb(main):032:0> p p
1 2 and i am a point
=> nil

irb(main):033:0> pp p            # note that @something is not printed 
out
1 2 and i am a point
=> nil

irb(main):034:0>
-- 
Posted via http://www.ruby-forum.com/.