From: "Berger, Daniel" Date: 2002-08-08T23:10:09+09:00 Subject: RE: struct needs to be a constant? > -----Original Message----- > From: ts [mailto:decoux@moulon.inra.fr] > Sent: Thursday, August 08, 2002 8:08 AM > To: ruby-talk@ruby-lang.org > Cc: ruby-talk@ruby-lang.org > Subject: Re: struct needs to be a constant? > > > >>>>> "B" == Berger, Daniel writes: > > >> rb_struct_define("Proto::ProtoStruct","name","aliases","number",0); > ^^^^^^^^^^^^^^^^^^^^ > ^^ > ^^ > > This is this that 1.7 don't like, and I understand it. I'm not sure what mean here (I'm having difficulty translating). Are you saying that this is expected behavior and that you agree with it? > > >> > void Init_proto() > ^^^^^ > ^^^^^ > > Now nobody can write an extension with the name `proto', even if your > extension is called via 'require "net/proto"' :-( Not true, at least not if I understand you correctly. With my own version of Net::Proto already installed, I wrote this and installed it: #include "ruby.h" #include void Init_proto() { VALUE t_mTest, cTest; t_mTest = rb_define_module("Test"); cTest = rb_define_class_under(t_mTest,"Proto",rb_cObject); printf("Yes, this extension works, even though it's called 'Proto'\n"); } In the extconf.rb I did this: require "mkmf" create_makefile('test/proto') Then I did: require "net/proto" require "test/proto" It seemed to work fine. Have I missed something? Regards, Dan