From: Regg Date: 2006-05-16T02:50:47+09:00 Subject: Re: begining programmer questions I'm a newbie to Ruby, but not to programming. But the follow statement made by "Michael Gorsuch" is confusing. "When you did 'info = gets.chomp', you wiped out your array and made it a simple String object." I thought that Ruby was a strong typed language. How can it change an Array to a String...I would have expected an error to be produced in this instance. I would have hoped that once a type has been established for an object, the object would only adhere to the rules of that object...not change itself into a new object type. I agree...this stuff can make you pull your hair out!! Argh... Michael Gorsuch wrote: > 'gets' will read a string from input and build a new string object. > > When you did 'info = gets.chomp', you wiped out your array and made it a > simple String object. > > 'exit' is being stored because your program logic is placing the string > into > the Array, and then checking to see if the last retrieved value is > 'exit'. > > You may be better off using a temporary variable first, checking it, and > then storing it. -- Posted via http://www.ruby-forum.com/.