[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02261] Re: setter() for local variables

From: ts <decoux@...>
Date: 2000-03-30 11:14:07 UTC
List: ruby-talk #2261
>>>>> "Y" == Yukihiro Matsumoto <matz@netlab.co.jp> writes:

Y> I've got another idea.  How about making marshaling wrapper for DBD.

 I've not understood, sorry. Actually I do this :

    if (dbst->marshal)
        a = rb_funcall(db_mMarshal, id_dump, 1, a);
    else {
        a = rb_funcall(a, id_to_s, 0);
    }
    key.data = RSTRING(a)->ptr;
    key.size = RSTRING(a)->len;

and 

    if (dbst->marshal)
        res = rb_funcall(db_mMarshal, id_load, 1, rb_str_new(a.data, a.size));
    else
        res = rb_tainted_str_new(a.data, a.size);

 i.e. if the database is open with {"marshal" => true}, I call Marshal#dump
 and Marshal#load for the key and the value, otherwise I call object#to_s

 What do you want say with "marshaling wrapper" ?


Guy Decoux


In This Thread