From: Kero van Gelder Date: 2001-11-19T06:16:09+09:00 Subject: [ruby-talk:25787] Subclassing native struct oddity --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, I expect to see an instance of Blaat, not Bla. See attachements. +--- Kero ------------------------------ kero@chello.nl ---+ | Don't split your mentality without thinking twice | | Proud like a God -- Guano Apes | +--- M38c ------- http://members.chello.nl/~k.vangelder ---+ --gBBFr7Ir9EOA20Yy Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="native.c" #include VALUE rb_cBla; VALUE bla_new(VALUE module) { int *b = ALLOC(int); VALUE bla; *b = 7; bla = Data_Wrap_Struct(rb_cBla, NULL, free, b); return bla; } void Init_native(void) { rb_cBla = rb_define_class("Bla", rb_cObject); rb_define_module_function(rb_cBla, "new", bla_new, 0); } --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="buggy.rb" require 'test/native' class Blaat < Bla end b = Blaat.new() p b --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="extconf.rb" require 'mkmf' create_makefile("native") --gBBFr7Ir9EOA20Yy--