>>>>> "J" == Jamie Knight <bigjim16 / btinternet.com> writes:

J> I know you need to use rb_funcall but how do you get the VALUE for the 1st
J> parameter(VALUE recv)? and what exactly is this parameter for?

 This is self.

 For example, in ruby you write

   class A
      def m(b)
      end
   end

   a = A.new
   a.m(12)

 This can be written :

   /* retrieve the class A */
   klass = rb_const_get(rb_cObject, rb_intern("A"));

   /* call the method new for A */
   obj = rb_funcall(klass, rb_intern("new"), 0);

   /* call the method m for this object */
   rb_funcall(obj, rb_intern("m"), 1, INT2FIX(12));

J> I can't find any example programs embedding ruby in c or much documentation
J> except for the extending ruby chapter in pragmatic programmer which doesn't
J> seem to explain this.

  You have example in RAA, like eruby ...



Guy Decoux