From: Robert Klemme Date: 2003-08-06T18:42:01+09:00 Subject: Re: Can't marshal MatchData? "Gavin Sinclair" schrieb im Newsbeitrag news:48928.203.185.214.34.1060113020.squirrel@webmail.imagineis.com... > Folks, > > I understand there are 4 kinds of things you can't marshal: singleton > methods, IO objects, bindings, and ... and ... someone will fill in. > > Why then, can't you marshal MatchData objects? To wit: > > irb(main):108:0> Marshal.dump(ms[63]).size > TypeError: can't dump MatchData > from (irb):108:in `dump' > from (irb):108 > from ?:0 > > [ms is an array of MatchData objects] > > I don't think MatchData is the fourth item in the incomplete list above. Maybe a Regexp reuses the same MatchData instance through all matches (this saves instantiations). If that were the case it would not make much sense marshalling a MatchData instance. Instead one should probably convert it into an array. Just my 5eurocent... robert