[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: instance_variable_[gs]et

Yukihiro Matsumoto

3/27/2008 4:43:00 AM

Hi,

In message "Re: instance_variable_[gs]et"
on Thu, 27 Mar 2008 13:36:23 +0900, Trans <transfire@gmail.com> writes:

|Why does #instance_variable_get/set require an "@" sign in front of
|the variable name? It's not like there is any other valid instance
|variable name, is there?

Because it's part of a method name.

|And why can't #instance_variable_set take a hash to set more than one
|variable at a time?

I don't think it makes programs cleaner.

matz.

1 Answer

Trans

3/27/2008 3:30:00 PM

0



On Mar 27, 12:43 am, Yukihiro Matsumoto <m...@ruby-lang.org> wrote:
> Hi,
>
> In message "Re: instance_variable_[gs]et"
> on Thu, 27 Mar 2008 13:36:23 +0900, Trans <transf...@gmail.com> writes:
>
> |Why does #instance_variable_get/set require an "@" sign in front of
> |the variable name? It's not like there is any other valid instance
> |variable name, is there?
>
> Because it's part of a method name.

Sorry matz, I don't follow. What is "it" and what method name?

T.