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?
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 <i>block</i> 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) }
*
* <em>produces:</em>
*
* Joe Smith
* 123 Maple, Anytown NC
* 12345
*/
Hi,
At Thu, 16 Sep 2004 01:20:01 +0900,
Kevin Howe wrote in [ruby-talk:112625]:
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?
Yes, but it's static.
···
--
Nobu Nakada