On Mon, 10 Jan 2005 19:00:55 +0900, Eustaquio Rangel de Oliveira Jr. <eustaquiorangel / yahoo.com> wrote: > I heard that immediate values holds the object, not a reference to > it, is that right? > > I mean: > > s1 = "test" # a String located on for ex 0xCC53D5DF > s2 = s1 # points to the same place as s1 > s3 = "test" # ANOTHER String, locate on for ex 0xC0DD54D0 > n1 = 1 # Fixnum here, located on ... ? > n2 = n1 # points to the same place as n1 > n3 = 1 # points to the same place as n1 > > So, Fixnum (as true, false and nil) objects uses the same object > for all over the program, but Strings, for ex, does not, even if > the value are the same there are distinct objects, right? > > On the end, n1, n2 and n3 are not reference to this only one > object allocated there, shared by all? Variables are not all > references, even on the Fixnum case, pointing to an allocated > single object there? Up until this paragraph I was with you and completely agree. Variables are all references, even to Fixnum and Symbol objects. It's an implementation detail that all Fixnum and Symbol object instances s are references to the same object, IMO. -austin -- Austin Ziegler * halostatue / gmail.com * Alternate: austin / halostatue.ca