From: Ross Bamford Date: 2005-12-31T20:07:29+09:00 Subject: Symbols/references (was: What is the difference between :foo and "foo" ?) On Fri, 30 Dec 2005 13:05:48 -0000, Malte Milatz wrote: > dblack: >> Actually, s = :sym doesn't produce a reference to :sym; >> rather, s has the actual/immediate value :sym. Anyway, the main >> (obscured) >> point was that symbols are not references. > > My understanding of things so far was that :sym and 3 are immediate > values, > and after writing > a, b = :sym, 3 > a is a reference to :sym and b is a reference to 3. > > Have I been wrong all the time? > I wonder that too. What about: a, b = :sym, :sym I guess a and b hold separate references to the same object, much as if I did a, b = 4, 4 That was the basis for my mentioning literal fixnums earlier in the ':foo and "foo"' thread, but now I wonder if I'm in fact wrong (again ;)). Basically I suppose I'm confused about assignment by value or reference. I though Ruby was pass by reference, with references passed by value, no matter what? -- Ross Bamford - rosco@roscopeco.remove.co.uk