From: dblack@... Date: 2006-01-05T09:57:34+09:00 Subject: Re: On Symbols Hi -- On Thu, 5 Jan 2006, Jim Weirich wrote: > DAB wrote: >> Fixnums, Symbols, true, false, and nil get assigned directly to >> variables. For other objects, variables get a reference to the >> object. References, like variables, are not themselves objects. >> They're part of a kind of language substratum on which the object >> system floats. > > True, but ... > >> [...] In fact, in a sense there's even >> less to it, since Ruby handles any necessary de-referencing for you, >> so you don't have to make any explicit distinction in your code. > > I think that this second statement is much more important than the > first. The fact that 1073741823 is direct and 1073741824 is a reference > makes very little difference 99.99% of the time. > > Understanding that Fixnums, Symbols and the such are direct is good for > groking implementation details, but provides little insight in using > Ruby. The fact we can pretend that everything is a reference is a > marvelous feature of the Ruby object model. It is indeed. I think one reason I'm so immediate-value-aware is the history of discussions of ++, the absence of which makes sense in light of the immediate value thing (with numbers). And I guess I'd put that at a middle level -- not something you really need to know to use Ruby, but not quite an implementation detail either; more of a language design thing. David -- David A. Black dblack@wobblini.net "Ruby for Rails", from Manning Publications, coming April 2006! http://www.manning.com/books/black