From: 7stud -- Date: 2012-09-19T02:10:49+09:00 Subject: Re: Bug or feature The line: a = ['0'] 1) First tells ruby to create the string at some location in memory: 1033 Maple Dr. ------- '0' 2) Then ruby inserts the address in a new array: [1033 Maple Dr.] 3) Then ruby does the assignment and makes the variable 'a' refer to that array: a -------> [1033 Maple Dr.] The line: b = a.clone 1) First, creates a copy of the 'a' array: [1033 Maple Dr.] 2) Then ruby does the assignment and makes b refer to the array: b -----> [1033 Maple Dr.] So the overall picture looks like this: a -----> [1033 Maple Dr.] 1033 Maple Dr. ------- '0' b -----> [1033 Maple Dr.] So when you use b to change the string that resides at 1033 Maple Dr., that effects 'a' because it also has an element that refers to 1033 Maple Dr. -- Posted via http://www.ruby-forum.com/.