From: Chris Sepic Date: 2008-02-03T08:39:50+09:00 Subject: how does sort work? I'm confused as to how the sort method works. If I have: a = [ "d", "a", "e", "c", "b" ] I know that a.sort {|x,y| x <=> y } (or just .sort) = ["a", "b", "c", "d", "e"] and a.sort {|x,y| y <=> x } = ["e", "d", "c", "b", "a"] I understand how the <=> operator works, but what exactly is going on in the block? What are x and y assigned to? -- Posted via http://www.ruby-forum.com/.