From: saladin.mundi@... Date: 2007-11-17T00:05:05+09:00 Subject: Some Core Questions This is a multi-part message in MIME format. ------=_NextPart_000_0097_01C8286A.7638D6A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi guys, first time using the mailing list, hope im not doing anything = wrongt :) ok ive got some questions about the ruby core 1. C-Methods: how is it possible to do a printf command for the = delivered VALUE parameters? Example VALUE rb_funcall(VALUE recv, ID mid, int n, ...) { ... } /* for example I would like to get the value of the variable recv printed = on the command line using something like printf(recv);=20 reason for that is, that is just want to see what values any variable = of the datatype VALUE has got I know that c types can be "easily" printed, like the type ID : = printf("%s", rb_id2name(nameOfVariableID)) */ 2. C-Method: how can I get to know the datatype of a VALUE variable? Example VALUE rb_somemethod(VALUE somevalue, VALUE anothervalue) { char s =3D TYPE(somevalue); /* imagined code */ printf("%s",s); /* imagined code */ } 3. C-Method: how can I call a method which is defined somewhere by using = C ? Example # Rubycode class RubyClass def x() p "x" end end /*C-code*/ void rb_call_a_func() { /*imagined code*/ getClass("RubyClass").getMethod("x").execute(); } =20 Thanks for your help, and sorry if I posted it in the wrong "section" ------=_NextPart_000_0097_01C8286A.7638D6A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi guys, first time using the mailing = list, hope im=20 not doing anything wrongt :)
ok ive got some questions about the = ruby=20 core
 
1. C-Methods: how is it possible to do = a printf=20 command for the delivered VALUE parameters?
 
Example
VALUE
rb_funcall(VALUE = recv, ID mid,=20 int n, ...)
{
  ...
}
/*
  for example I would = like to=20 get the value of the variable recv printed on the command line using = something=20 like printf(recv); 
  reason for that is, that is = just want=20 to see what values any variable of the datatype VALUE has=20 got
 
  I know that c types can be = "easily"=20 printed, like the type ID : printf("%s",=20 rb_id2name(nameOfVariableID))
*/
 
 
2. C-Method: how can I get to = know the=20 datatype of a VALUE variable?
 
Example

VALUE
rb_somemethod(VALUE = somevalue, VALUE=20 anothervalue)
{
  char s =3D TYPE(somevalue); /* imagined=20 code */
  printf("%s",s); /* imagined code=20 */
}

3. C-Method: how can I call a method which is defined somewhere = by=20 using C ?
 
Example
# Rubycode
class RubyClass
  def x()
    p = "x"
 =20 end
end
/*C-code*/
void
rb_call_a_func()
{
  /*imagined=20 code*/
  = getClass("RubyClass").getMethod("x").execute();
} =20
 
Thanks for your help, and sorry if I posted it in the wrong=20 "section"
------=_NextPart_000_0097_01C8286A.7638D6A0--