Bug #10125

Array#sort and #sort! documentation issue

Added by Maxime Réty 9 months ago. Updated 9 months ago.

[ruby-core:64306]
Status:Assigned
Priority:Normal
Assignee:Zachary Scott
ruby -v:2.1.2 Backport:2.0.0: UNKNOWN, 2.1: UNKNOWN

Description

The documentation about the values that should be returned by the block is backwards.

a <=> b will return -1 if a is lower than b, i.e. b follows a (in the sorted array).
a <=> b will return 1 if a is greater than b, i.e. a follows b (in the sorted array).

Using the "follows" verbal form might not be the best choice here, but I'd rather let a native english speaker rephrase it if needed.

This part of the documentation is backwards since the 2.0.0 release (commit 53b61ccb).

Thanks.

0001-array.c-Fixing-documentation-about-comparisons-in-so.patch Magnifier (1.25 KB) Maxime Réty, 08/11/2014 04:57 PM


Related issues

Related to Ruby trunk - Bug #9989: Docs give wrong information for sort block return values Open 06/28/2014

History

#1 Updated by Zachary Scott 9 months ago

  • Status changed from Open to Assigned

#2 Updated by Ayumu AIZAWA 5 months ago

  • Related to Bug #9989: Docs give wrong information for sort block return values added

Also available in: Atom PDF