From: "Berger, Daniel" Date: 2002-08-08T21:38:22+09:00 Subject: RE: struct needs to be a constant? > -----Original Message----- > From: GOTO Kentaro [mailto:gotoken@notwork.org] > At Thu, 8 Aug 2002 05:27:27 +0900, > Daniel Berger wrote: > > > test.rb:3:in `require': identifier Proto::ProtoStruct needs > to be constant (NameError) from > > test.rb:3 > > > void Init_proto() > > { > > VALUE np_mNet; > > np_mNet = rb_define_module("Net"); > > cNetProto = rb_define_class_under(np_mNet,"Proto",rb_cObject); > > > > sProto = > rb_struct_define("Proto::ProtoStruct","name","aliases","number",0); > > rb_global_variable(&sProto); > > try replacing the last two lines by > > sProto = > rb_struct_define("ProtoStruct","name","aliases","number",0); > rb_define_const(cNetProto, "ProtoStruct", sProto); Actually, it looks like either a bug or a behaviorial change in 1.7.2. I don't get this error with 1.6.7. I'll grab the nightly build and see if that changes anything. Regards, Dan