From: Tim Hunter Date: 2004-09-16T07:34:51+09:00 Subject: Re: rb_struct_each_pair Kevin Howe wrote: > Hi, I'm toying with ruby 1.8.2 C extensions and am trying to use > rb_struct_each_pair: > > http://www.eng.cse.dmu.ac.uk/~hgs/ruby/rubycvsdocs/classes/Struct.html#M001234 > > but am getting an "undeclared identifier" error. Is this function not > included in 1.8.2? It's not defined in any version of Ruby that I have available (1.6.7, 1.6.8, 1.8.1, 1.8.2 preview1). Is it possible you want rb_struct_each instead? /* * call-seq: * struct.each {|obj| block } => struct * * Calls block once for each instance variable, passing the * value as a parameter. * * Customer = Struct.new(:name, :address, :zip) * joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345) * joe.each {|x| puts(x) } * * produces: * * Joe Smith * 123 Maple, Anytown NC * 12345 */