[ruby-talk:02378] Re: Marshal: Want string out, but want depth specified?

From: matz@... (Yukihiro Matsumoto)
Date: 2000-04-07 18:04:37 UTC
List: ruby-talk #2378
Hi,

In message "[ruby-talk:02375] Marshal: Want string out, but want depth specified?"
    on 00/04/07, Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:

|@encoded = [Marshal.dump(@decoded, , depth)].pack("m")
|
|gives a syntax error,

Because you can't omit the second argument.

|@encoded = [Marshal.dump(@decoded, nil, depth)].pack("m")
|
|doesn't work, the second param needs to be type IO

Yes.

|@encoded = [Marshal.dump(@decoded, depth)].pack("m")
|
|doesn't work, the second param needs to be type IO

Hmm, I designed this to work.  And works fine on my box.  The only
limitation I can think of is depth must be a Fixnum.

							matz.

In This Thread