identification of VALUE recv

S

saladin.mundi

hey=20
how is it possible to get the value(s) of the variable receiver in =
rb_funcall?

Function:
VALUE
rb_funcall(VALUE recv, ID mid, int n, ...) =20

is there something like: StringValueCStr(recv) ?

the thing is, I want to know if a function x was called by rb_funcall. =
therefor I want to see if the value of the revc is something like "x"

Further example:

class X
def hi()
p "hello"
end
end
ix =3D X.new
ix.hi # rb_funcall is invoked=20

so the recv shall be hi() , which should be the value of recv or??

thank you
 
R

Ryan Davis

Further example:

class X
def hi()
p "hello"
end
end
ix = X.new
ix.hi # rb_funcall is invoked

so the recv shall be hi() , which should be the value of recv or??

no, recv is the VALUE for ix. mid is the id for :hi, n will be 0. It
would be roughly equivalent to :

rb_funcall(ix, rb_intern("hi"), 0);

What I _think_ you're asking is "what is the name of the reciever for
this rb_funcall" and there isn't one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top