From: Aleksei Guzev Date: 2001-07-04T19:06:14+09:00 Subject: [ruby-talk:17227] Re: Getting variable name # -----Original Message----- # From: Holden Glova [mailto:dsafari@xtra.co.nz] # Sent: 4 ???? 2001 ?. 15:04 # To: ruby-talk ML # Subject: [ruby-talk:17226] Re: Getting variable name # # # -----BEGIN PGP SIGNED MESSAGE----- # Hash: SHA1 # # On Wed, 04 Jul 2001 20:40, DaVinci wrote: # > Hi. # > # > How can I get a variable name string?. Example: # > # > @foo -> 'foo' # > # > Greets. # > # > David # # Hi David, # # I'm going to go out on a limb here and assume you can't because that # is an instance variable and you don't have an instance. Assuming you # did have an instance you would have a public method that would give # you the name(s). # # Just a thought. # That's right. You do not need such method. Everywhere You could call the method You would type the variable name by Yourself. When a variable is used as actual parameter to a function call its value is assigned to another variable ( the formal parameter of the function ). The value itself does not have a name.