From: samuel@... Date: 2016-01-10T23:12:33+00:00 Subject: [ruby-core:72800] [Ruby trunk - Bug #11975] [Open] Range#last is not consistent and possibly does not do what is expected. Issue #11975 has been reported by Samuel Williams. ---------------------------------------- Bug #11975: Range#last is not consistent and possibly does not do what is expected. https://bugs.ruby-lang.org/issues/11975 * Author: Samuel Williams * Status: Open * Priority: Normal * Assignee: * ruby -v: 2.3.0 * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- The following example demonstrates an inconsistency with Range: This is expected behaviour: ~~~ (0..10).last => 10 (0..10).to_a.last => 10 ~~~ This is unexpected behaviour: ~~~ (0...10).last => 10 # (should be 9?) (0...10).to_a.last => 9 ~~~ I believe that Range#last should give the last valid value for a range. Discussion? -- https://bugs.ruby-lang.org/ Unsubscribe: