From: Clemens Hintze Date: 2000-03-16T22:24:40+01:00 Subject: [ruby-talk:01926] Re: object creation Andrew Hunt writes: ... > What I am trying to understand is the most legitimate way > to create objects from C. In the case of built-in classes, > a "C-constructor" is available (rb_str_new, etc). For extension > classes, the question is a little murkier. I think the best > answer is that your own class should use Wrap_Struct/Make_Struct > and rb_bj_call_init, and that it should provide a C-level > constructor for others to use. If that's not available, then > the next best thing would be to use funcall to call the "new" > method of the class. I don't see any case where it > it would be prudent to call NEWOBJ/SETUPOBJ or poke around in > the internals of another class in order to instantiate it. > > Does this sound okay? Or am I missing something? That sounds okay for me. But please read also my reply to [ruby-talk:01922]. BTW: It is really strange today with the mails from ruby-talk. I get them totally unordered. Most often the answers reach me before the question ;-))) > /\ndy \cle ... > Our New Book: "The Pragmatic Programmer" Published by Addison-Wesley > Oct 1999 ???? Really?!? Damned I have totally missed it! Or is it just another Y2K bug??? ;-) ... -- Clemens Hintze mailto: c.hintze@gmx.net