Issue #14823 has been updated by marcandre (Marc-Andre Lafortune).


duerst (Martin Drst) wrote:
> mame (Yusuke Endoh) wrote:
> > but there is no such thing as
> > 
> > ```
> > [1, íš]
> > ```
> 
> It is true that this is the convention followed in Mathematics.

It actually depends which mathematics we are talking about. Transfinite mathematics deal with different infinities. Check in particular the "surreal numbers".

Still, for Ruby, I agree that it would be best to have something simple.

I would accept (x..) and automagically change it to (x...).

    (42..) # => (42...)
    (42..) == (42...) # => true

I particularly like the fact that "42..." is a nice notation for "42 and up".



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

* 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>