Hi,

At Wed, 13 Mar 2002 01:26:44 +0900,
Bob Alexander wrote:
> ------------------
> "p" method should return its last argument, unconverted.
> 
> (It currently returns nil.) This would allow it to be more conveniently inserted into expressions during debugging:
> E.g. in
>    a = d + b / c
> To quickly see what the subexpression (b / c) is producing
>    a = a + p(b / c)
> or
>    a = d + p("***** b / c:", b / c)

Once in order to debug method chains I wrote similar method
like as:

  module Kernel
    def p!
      p self
      self
    end
  end

How about that p without arguments print self?  And it were
return the last argument, you can write:

  class Object
    def p(*args)
      args << self if args.empty?
      super(*args)
      args.last
    end
  end

  some_thing.wicked.p.this_chain.comes


Hmmm, it may be better to separate p and p!...

-- 
Nobu Nakada