From: Dave Thomas Date: 2004-04-05T02:26:00+09:00 Subject: Re: Variable names On Apr 4, 2004, at 10:45, David King Landrith wrote: > After 2 days and several emails, I still have no idea how the > characters are getting evaluated and resolved by the interpreter and > at what point these resolved or evaluated characters are disposed of > in favor of the objects that they represent. Moreover, I still have > no idea if or why this question may reflect a category mistake. > > I have no experience in writing compilers/interpreters, and I don't > believe that I should have to in order to learn about such topics. I think tis might well be the underlying issue. To understand _why_ people are saying that your question on the surface doesn't make sense to them, so have to invest some time meeting them in the middle when they explain the issues. They are honestly trying to be helpful, but the underlying issue is more complex than you'd like it to be. This isn't a language issue, it's a conceptual one. The problem would be the same in most languages, and with most technologies. An object may be referenced from many variables at the same time, and each variable may reference many objects over its life. Given that, it's hard to think of a possible API that would let you know the name of a variable that was used to reference an object. Consider. def so_something_with(v1, v2) # your checks go here end a = cat do_something_with(a, a) Within the context of the method, how would you (from the object "cat") go about resolving the name of a variable used to reference you? Variables don't really exist in their own right: they are not objects, and have no behavior other than containment. Cheers Dave