From: Wayne Brissette Date: 2011-11-05T02:49:34+09:00 Subject: What happens in dual sorts with nil values? I've put together an array that has a map. I did this so I could do some multi-level sorting of data. For example, if I had a map with: Struct.new(:first, :last, :age) And let's say I only had some of the ages, so some values were nil. Doing a multi-level sort using person.sort_by! { |a| [a.last, a.first, a.age]} gives me a list sorted correctly by last name, then first, and age?? (maybe, I need to test more) If I put the sort_by with a.age first, then I get an error. `block in ': undefined local variable or method `ball_map' for main:Object (NameError) I'm assuming this is because I'm trying to sort integers and have one with a nil value. So my question really is two-fold. Can I sort based on age if some values are nil? (doesn't look like it), and second, am I fooling myself into thinking that I'm sorting on a.age when it's not the first sort value? Wayne