From: Tom Sawyer Date: 2003-01-04T06:26:15+09:00 Subject: Re: dump depth argument On Friday 03 January 2003 01:58 pm, Dossy wrote: > While the limit would be more useful if it weren't a hard limit but > instead a suggested limit, it does behave as documented, IMHO. > > rb(main):090:0> rdio, wrio = IO.pipe > [#, #] > > irb(main):091:0> Marshal.dump(foo, wrio, 3); wrio.print "\n"; wrio.flush > # > > irb(main):092:0> rdio.readline > "\004\006o:\010Foo\006:\t@fooo:\010Bar\006:\t@bar\"\010baz\n" > > As I said, it'd be more interesting if the limit parameter to > Marshal#dump simply stopped the recursive traversal of child > objects at limit, instead of throwing an error ... but, I'm > not the language implementer, so it's not my call to make ... thanks Dossy, that's very helpful. now i finally know how to take an IO, use it and print it. as for the hard limit, i agree. why raise an error? why not just stop there? well, i'm going to try to get it to do just that. with any luck i can rescue the error and flush what i have. we'll see. thanks again, transami