corresponding C-method for setting and changing a local or globalvariable

S

saladin.mundi

its me again, still having trouble with the c-core.

im trying to find the c-method(s) which is responsible if a local or =
global variable is set.

example:

class X
$globvar =3D "hey" <- setting/instanciation of a global variable
def hello
hi =3D "hi" <- setting/instancition of a local variable
end
end

I've found out that the responsible methods for setting a class variable =
is: rb_cvar_set
, for setting an instancevariable is rb_ivar_set and for constants =
rb_const_set

I hope you can help me with finding the right methods for local and =
global vars

thanks so much!!
 
T

Tim Hunter

its me again, still having trouble with the c-core.

im trying to find the c-method(s) which is responsible if a local or global variable is set.

example:

class X
$globvar = "hey" <- setting/instanciation of a global variable
def hello
hi = "hi" <- setting/instancition of a local variable
end
end

I've found out that the responsible methods for setting a class variable is: rb_cvar_set
, for setting an instancevariable is rb_ivar_set and for constants rb_const_set

I hope you can help me with finding the right methods for local and global vars

thanks so much!!

Define a global variable with rb_define_variable. Set and get the
variable's value with rb_gv_set and rb_gv_get.

There is no function that works with local variables.
 
S

saladin.mundi

*push*
----- Original Message -----
From: <[email protected]>
To: "ruby-talk ML" <[email protected]>
Sent: Friday, November 23, 2007 3:14 PM
Subject: corresponding C-method for setting and changing a local or global
variable


its me again, still having trouble with the c-core.

im trying to find the c-method(s) which is responsible if a local or global
variable is set.

example:

class X
$globvar = "hey" <- setting/instanciation of a global variable
def hello
hi = "hi" <- setting/instancition of a local variable
end
end

I've found out that the responsible methods for setting a class variable is:
rb_cvar_set
, for setting an instancevariable is rb_ivar_set and for constants
rb_const_set

I hope you can help me with finding the right methods for local and global
vars

thanks so much!!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top