著作一覧 |
require 'stringio' a = [1, 2, 3] a << a p a b = [a] a << b p a b << a p b x = "" s = StringIO.new(x) Marshal.dump(a, s) s.close p x s = StringIO.new(x) na = Marshal.load(s) p na実行してみる。
C:?home?tmp>ruby ar.rb [1, 2, 3, [...]] [1, 2, 3, [...], [[...]] [[1, 2, 3, [...], [...]], [1, 2, 3, [...], [...]]] "?x04?b[?ni?x06i?ai?b@?x00[?a@?x00@?x00" [1, 2, 3, [...], [[...], [...]]]
ジェズイットを見習え |