[#686] Wall compilation — Michal Rokos <michal@...>
Hi everybody,
[#688] mkmf.rb - add files to clean and distclean targets — Michal Rokos <michal@...>
Hi,
On Thu, 16 Jan 2003, Michal Rokos wrote:
Hi,
Hi,
On Tue, Jan 21, 2003 at 11:16:39AM +0900, Yukihiro Matsumoto wrote:
Hi,
On Tue, Jan 21, 2003 at 06:38:00PM +0900, Yukihiro Matsumoto wrote:
Hi,
On Tue, Jan 21, 2003 at 11:37:35PM +0900, Yukihiro Matsumoto wrote:
Hi,
Hello,
Hi,
Hi,
Hi,
Hi,
[#708] Documentation for thread.rb — Gavin Sinclair <gsinclair@...>
Hi ruby-core,
[#719] nd_end and NODE_NEWLINE (fwd) — Chad Fowler <chad@...>
[#724] Symbols: More Functionality Wanted — Ryan Pavlik <rpav@...>
I've been discussing this for a bit on #ruby-lang on OPN (or freenode or
Hi,
On 20 Jan 2003 at 15:49, Yukihiro Matsumoto wrote:
Hi --
On Thursday, January 23, 2003, 6:28:04 AM, dblack wrote:
Gavin Sinclair <gsinclair@soyabean.com.au> writes:
Hi,
matz@ruby-lang.org (Yukihiro Matsumoto) writes:
Hi,
On Fri, 24 Jan 2003 03:34:46 +0900
[#730] Comments on matrix.rb — Gavin Sinclair <gsinclair@...>
Hi -core,
[#757] Extensions for Time and ParseDate — Ryan Davis <ryand-ruby@...>
Eric and I have been hacking around and we can't stand the lack of
[#759] Adding Test::Unit to CVS — "Nathaniel Talbott" <nathaniel@...>
Matz has already given me the go-ahead to add Test::Unit to CVS, but I
Nathaniel Talbott wrote:
On Wednesday, January 22, 2003, at 07:56 AM, Dave Thomas wrote:
Forward: Marshal patch
Hi,
Fowarding.
Delivery-Date: Thu Jan 16 06:05:13 2003
Date: Wed, 15 Jan 2003 12:54:51 -0800
From: Ryan Pavlik <rpav@nwlink.com>
Subject: Marshal patch
Hi, I apologize if I'm sending this to the wrong place---but here's a
simple patch for marshal.c that adds _pre_dump and _post_load calls.
Would it be possible to get this integrated into 1.8?
The usefulness is as follows: if you merely need to alter an object
before serialization, but the default marshal routine is OK, then this
lets you do that.
For instance, I can walk through an object and replace any Persistant
objects with an OID for the object (in the database), then restore the
references from the database on load.
If I should send this to someone else, please let me know. Thanks.
--
Ryan Pavlik <rpav@users.sf.net>
"Now if you'll excuse me, I've got to single-handedly
save a film genre."
diff -ru ruby-1.8.0/marshal.c ruby-1.8.0-rpav/marshal.c
--- ruby-1.8.0/marshal.c 2002-12-23 15:55:30.000000000 -0800
+++ ruby-1.8.0-rpav/marshal.c 2003-01-15 12:14:13.000000000 -0800
@@ -77,6 +77,7 @@
static ID s_dump, s_load;
static ID s_dump_data, s_load_data, s_alloc;
static ID s_getc, s_read, s_write;
+static ID s_pre_dump, s_post_load;
struct dump_arg {
VALUE obj;
@@ -343,6 +344,10 @@
if (limit == 0) {
rb_raise(rb_eArgError, "exceed depth limit");
}
+
+ if(rb_respond_to(obj, s_pre_dump))
+ rb_funcall(obj, s_pre_dump, 1, INT2NUM(limit));
+
if (obj == Qnil) {
w_byte(TYPE_NIL, arg);
}
@@ -1183,7 +1188,12 @@
r_object(arg)
struct load_arg *arg;
{
- return r_object0(arg, arg->proc);
+ VALUE v = r_object0(arg, arg->proc);
+
+ if(rb_respond_to(v, s_post_load))
+ rb_funcall(v, s_post_load, 0);
+
+ return v;
}
static VALUE
@@ -1273,6 +1283,8 @@
s_getc = rb_intern("getc");
s_read = rb_intern("read");
s_write = rb_intern("write");
+ s_pre_dump = rb_intern("_pre_dump");
+ s_post_load = rb_intern("_post_load");
rb_define_module_function(rb_mMarshal, "dump", marshal_dump, -1);
rb_define_module_function(rb_mMarshal, "load", marshal_load, -1);
--
Nobu Nakada