From: Erik Veenstra Date: 2005-06-18T09:15:33+09:00 Subject: Re: Why do arrays work this way? > a=[1,2,3,4,5] This creates a specific object of class Array. "a" is a pointer to the array-object. Just to be sure, I didn't say: "a" is the array-object... > b=a > > c=a Now "b" and "c" point to the same object as "a". > so what's the logic behind 'a' & 'c' changing when I change > 'b'. I think you can now answer it yourself... > Is this a bug? and if not what's the reasoning behind this > behaviour please. There's only one type for variables in Ruby: pointer. Pointer to nothing (=nil) or pointer to an object. There's no such thing as storing an object in a variable. Have you read "Programming Ruby, The Pragmatic Programmer's Guide" [1]? Extra info: In Java, there's a difference between "int" and "Integer". Variables of type "int" store direct values, whereas variables of type "Integer" only store pointers, like in Ruby. Pointers in Ruby are typeless and pointers in Java are of a certain type. gegroet, Erik V. - http://www.erikveen.dds.nl/ [1] http://www.rubycentral.com/book/index.html