On Behalf Of [email protected]
#But it’s a question of whether <=> is defined or not, so C.new is in
#exactly the same position as nil. So the question is: if [C.new]
#(one-element array) “sorts”, why should [nil] not “sort”?
yes, single elements do return regardless. i was used to thinking
nil-filled arrays wont sort directly. pls forgive my noise.
in general,
[anyobject].sort always return [anyobject]
but
[anyobject,anyobject].sort may or may not be defined (unless filtered
by block)
thanks to everyone for the enlightenment.
kind regards -botp
ps: this may be for a new thread, and i should have asked this a long
time ago, but: why no <=> op for nil? so [nil, nil, nil].sort => [nil,
nil, nil]