------ art_59243_28696251.1164247642438 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Eek. There goes my street cred. On 11/22/06, Morton Goldberg <m_goldberg / ameritech.net> wrote: > > On Nov 22, 2006, at 8:48 PM, Jason Mayer wrote: > > > I thought I was going to get to contribute, but then I got stuck. I > > installed the latest ruby, wrote a quick program that I thought > > would do it, > > and it didn't. So I expanded on the program, trying to figure out > > what was > > going on, and now it's 20 lines long(mostly puts) and I *still* > > don't get > > something (Beware - the single most basic code ever follows - it was > > originally much nicer but then I got to trying to debug) > > > > a rray.new > > a w{test test2 test3} > > puts a > > aSize .size > > b rray.new > > b w{test3 nil test2 test} > > bSize .size > > puts 'size of b:' + bSize.to_s > > puts b > > puts 'size of a:' + aSize.to_s > > if aSize Size > > In Ruby s only used for assignment. For testing use > > > aSorted .sort! > > bSorted .sort! > > if aSorted.eql?(bSorted) > > puts 'ssdd' > > else > > puts 'same size, different values' > > end > > else > > puts 'not the same size' > > end > > > >> ruby array.rb > > test > > test2 > > test3 > > size of b:4 > > test3 > > nil > > test2 > > test > > size of a:3 > > same size, different values > > > > What's wrong with if aSize Size? That seems the most intuitive > > way to do > > it to me... I mean, it's an integer... why is it going inside the > > loop at > > all? > > Regards, Morton > > > > ------ art_59243_28696251.1164247642438--