Project

General

Profile

Bug #10125

Array#sort and #sort! documentation issue

Added by maxtruc (Maxime Réty) almost 3 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
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.


Related issues

Related to Ruby trunk - Bug #9989: Docs give wrong information for sort block return valuesClosed

History

#1 [ruby-core:64307] Updated by zzak (Zachary Scott) almost 3 years ago

  • Status changed from Open to Assigned

#2 [ruby-core:67320] Updated by ayumin (Ayumu AIZAWA) over 2 years ago

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

#3 [ruby-core:79873] Updated by stomar (Marcus Stollsteimer) 5 months ago

Closing, fixed with r51859.

#4 [ruby-core:79874] Updated by stomar (Marcus Stollsteimer) 5 months ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF