Project

General

Profile

Actions

Bug #10125

closed

Array#sort and #sort! documentation issue

Added by maxtruc (Maxime Réty) over 10 years ago. Updated almost 8 years ago.

Status:
Closed
Assignee:
Target version:
-
ruby -v:
2.1.2
[ruby-core:64306]

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.


Files


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #9989: Docs give wrong information for sort block return valuesClosedzzak (zzak _)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0