Aleksi Niemel<aleksi.niemela / cinnober.com> wrote:
>
[...]
> > If it doesn't then for the most part, the built-in
> > functionality with "p" is good enough for me.
>
>I'm not entirely following you here, Ben.
>
>ruby -e'class Foo; attr_accessor :foo; end; f = Foo.new; f.foo=f; p f;'
>#<Foo:0x4017aa90 @foo=#<Foo:0x4017aa90 ...>>
>
[...]
>Anyway, I know the pain you might be referring to, as for example simple
>test for arrays does not work out:
>
>   ruby -e'b = ['b']; a = [b]; a << a; p a;'
>   [[nil], [...]]
>
>	- Aleksi

Pretty much what I was thinking of.  Also consider
this case:

    a = ["a"]
    b = [a, a, a]
    p b # IIRC (no interpreter to test) [["a"], ["a"], ["a"]]

which gives no clue to the dangers lurking in

    b[0].push "gotcha!"

Cheers,
Ben
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com