This is a multi-part message in MIME format.
------ extPart_000_0097_01C8286A.7638D6A0
Content-Type: text/plain;
charset so-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);
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 = 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();
}
Thanks for your help, and sorry if I posted it in the wrong "section"
------ extPart_000_0097_01C8286A.7638D6A0
Content-Type: text/html;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16544" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi guys, first time using the mailing list, hope im
not doing anything wrongt :)</FONT></DIV>
<DIV><FONT face=Arial size=2>ok ive got some questions about the ruby
core</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1. C-Methods: how is it possible to do a printf
command for the delivered VALUE parameters?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Example<BR>VALUE<BR>rb_funcall(VALUE recv, ID mid,
int n, ...)<BR>{<BR> ...<BR>}<BR>/*<BR> for example I would like to
get the value of the variable recv printed on the command line using something
like printf(recv); </FONT></DIV>
<DIV><FONT face=Arial size=2> reason for that is, that is just want
to see what values any variable of the datatype VALUE has
got</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> I know that c types can be "easily"
printed, like the type ID : printf("%s",
rb_id2name(nameOfVariableID))</FONT><FONT face=Arial
size=2><BR>*/<BR></FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>2. C-Method: how can I get to know the
datatype of a VALUE variable?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Example</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>VALUE<BR>rb_somemethod(VALUE somevalue, VALUE
anothervalue)<BR>{<BR> char s = TYPE(somevalue); /* imagined
code */<BR> printf("%s",s); /* imagined code
*/<BR>}<BR></FONT></DIV><FONT face=Arial size=2>
<DIV><BR>3. C-Method: how can I call a method which is defined somewhere by
using C ?</DIV>
<DIV> </DIV>
<DIV>Example<BR># Rubycode</DIV>
<DIV>class RubyClass<BR> def x()<BR> p "x"<BR>
end<BR>end<BR></DIV>
<DIV>/*C-code*/<BR>void<BR>rb_call_a_func()<BR>{<BR> /*imagined
code*/<BR> getClass("RubyClass").getMethod("x").execute();<BR>}
<BR></DIV>
<DIV> </DIV>
<DIV>Thanks for your help, and sorry if I posted it in the wrong
"section"</FONT></DIV></BODY></HTML>
------ extPart_000_0097_01C8286A.7638D6A0--