[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Re: lib/ostruct.rb 1.12 - wrong commit?

From: Mauricio Fern疣dez <batsman.geo@...>
Date: 2004-11-04 21:39:21 UTC
List: ruby-core #3690
On Fri, Nov 05, 2004 at 05:59:02AM +0900, Yukihiro Matsumoto wrote:
> Hi,
> 
> In message "Re: lib/ostruct.rb 1.12 - wrong commit?"
>     on Fri, 5 Nov 2004 02:49:51 +0900, Eivind Eklund <eivind@FreeBSD.org> writes:
> 
> |The above mentioned commit makes OpenStructs into singletons, which
> |again makes it impossible to dump them with Marshal.dump.  This breaks
> |rpa-base internally.  
> 
> We know the problem.  Wait for a while.  We will consider your patch.

Does the following make sense?

--- ostruct.rb.orig     2004-11-04 19:03:04.000000000 +0100
+++ ostruct.rb  2004-11-04 19:04:38.000000000 +0100
@@ -113,6 +113,15 @@
     return false unless(other.kind_of?(OpenStruct))
     return @table == other.table
   end
+
+  def marshal_dump
+      @table
+  end
+
+  def marshal_load(obj)
+      @table = obj
+      @table.each_key{|key| self.new_ostruct_member(key) }
+  end
 end


-- 
Hassle-free packages for Ruby?
RPA is available from http://www.rubyarchive.org/

In This Thread