Project

General

Profile

Actions

Bug #14823

closed

Endless Range Excluding End

Added by jeremyevans0 (Jeremy Evans) almost 6 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-openbsd]
[ruby-core:87393]

Description

Does it make sense for an endless range to exclude the end? It is currently supported, but the semantics are questionable.

(1..)
# => 1..
(1...)
# => 1...
(1...) == (1..)
# => false

I think it may be better to only allow .. for endless ranges, and not allow .... I think the use of ... with an endless range should be a SyntaxError.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0