--0-822842872-11318501847918
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Well, it turns out writing C extensions wasn't as easy as I had originally thought, and for only one reason: poor documentation.  Maybe I'm missing something though, does anyone know where the ruby API is documented?
 
If not, there are two specific questions that need answering.  First, how would I retrieve a class name into a variable using rb_const_get(VALUE, ID)?  I tried something like VALUE StringClass  b_const_get(rb_cObject, rb_intern("MyClass")), but I kept getting compile errors like "initializer is not a constant."  Second, how exactly should you use rb_define_method with an arg count of -1?  I tried making a function like func(VALUE argc, VALUE *argv, VALUE), but when I call it from ruby like func(1, 1, 1, 1), I get an arg count of 2.  It seems that the arg count is getting a count of only half the actual number arguments rounded down.  The args are still getting passed into argv, but it would be nice to be able to check the arg count without being off by one.  One final thing (I guess you could call this a third question).  What is wrong with the line rb_require("myfile")?  It says there should be a ')' before the string as well as a '{'.  There is also an '<Unkown>' error an
 d
 another misplaced '(' error.  Thanks a ton for any help; I really wish this API were actually documented.  At all.

		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  
--0-822842872-11318501847918--