on some extension project for win32 the funcions looks
like this
VALUE DoStuff( VALUE self, VALUE aval )
{
[…]
}
and in ruby_define_method the cnt for params is 1.
And on some other projects the value "VALUE self"
is not there.
Why?
What is the VALUE self?
Why on some files the VALUE self is not there?
···
–
mario junkalz
mario junkalz wrote:
on some extension project for win32 the funcions looks
like this
VALUE DoStuff( VALUE self, VALUE aval )
{
[…]
}
and in ruby_define_method the cnt for params is 1.
And on some other projects the value “VALUE self”
is not there.
Why?
What is the VALUE self?
Why on some files the VALUE self is not there?
In straight C, VALUE foofunc() essentially means to take (but,
generally, ignore) any number of arguments. (In C++ it’d be VALUE
foofunc(…), since VALUE foofunc() is VALUE foofunc(void), but I
digress…).
When an object or module calls a member function, it always passes the
VALUE self, but if you don’t need it for a particular function, you can
ignore it, perhaps at the expense of clarity.
Julian