3 Matching Annotations
- Jul 2020
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
I guess much like Range literals in general, it's often needed to have parens around them.
Tags
Annotators
URL
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
Why don't you allow a range without end, like (1..)? There are two advantages. First, we can write ary[1..] instead of ary[1..-1]. The -1 is one of the most I dislike in Ruby. It is very magical, ugly, redundant, and disappointing. I envy Python's ary[1:]. I know that ary.drop(1) is slightly fast, but too long for such a common operation, IMO. Second, we can write (1..).each {|n| ... }.
-
-
www.ruby-lang.org www.ruby-lang.org
-
A beginless range is experimentally introduced. It might not be as useful as an endless range, but would be good for DSL purposes.
-