Issue #14823 has been updated by mame (Yusuke Endoh).

Status changed from Open to Feedback

Thank you for the comment.

This argument is very subtle.  Some (mathematical) people says that we should have `(1...)` because of two reasons:

* `...` is preferably used to port Python code to Ruby because Python's `::` is literally corresponded to Ruby's `...`.
* `(1..)` is semantically weird because it does not include the infinity.

In other aspect, I like `(1..)` for casual use because it is shorter than `(1...)`.  Also, `ary[1..]` looks better than `ary[1...]`.

So, currently, we have both.  If you have any practical issue caused by having both, let me know.

----------------------------------------
Bug #14823: Endless Range Excluding End
https://bugs.ruby-lang.org/issues/14823#change-72388

* Author: jeremyevans0 (Jeremy Evans)
* Status: Feedback
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0preview2 (2018-05-31 trunk 63539) [x86_64-openbsd]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
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. 



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>