[#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:01894] Re: object creation

From: Andrew Hunt <andy@...>
Date: 2000-03-16 16:18:16 UTC
List: ruby-talk #1894
	>|  NEWOBJ(obj, c-type)  -- allocate memory for an object
	>|  OBJSETUP(obj, class, T_class); -- set appropriate flags
	>|  rb_obj_call_init(obj, argc, argv); -- call initialize
	>
	>Yes.  But I think it's better for T_DATA object to use
	>Data_Make_Struct/Data_Wrap_Struct, as Clemens stated.

Agreed, but here's my real question: suppose you have a non-built-
in class such as MD5, which does not expose a C-level constructor
(something like rb_str_new, rb_time_new, etc).  What is the 
preferred way to create a new MD5 object from C code?

Thanks,

/\ndy

--
Andrew Hunt, The Pragmatic Programmers, LLC.
Innovative Object-Oriented Software Development
web:   http://www.pragmaticprogrammer.com   email: andy@pragmaticprogrammer.com
--
Our New Book: "The Pragmatic Programmer" Published by Addison-Wesley Oct 1999
              (see www.pragmaticprogrammer.com/ppbook)
--

In This Thread

Prev Next