[ruby-cvs:70283] mame:r63192 (trunk): Introduce endless range [Feature#12912]

mame at ruby-lang.org mame at ruby-lang.org
Fri Apr 20 00:18:51 JST 2018


mame	2018-04-20 00:18:50 +0900 (Fri, 20 Apr 2018)

  New Revision: 63192

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63192

  Log:
    Introduce endless range [Feature#12912]
    
    Typical usages:
    ```
    p ary[1..]          # drop the first element; identical to ary[1..-1]
    (1..).each {|n|...} # iterate forever from 1; identical to 1.step{...}
    ```

  Modified files:
    trunk/internal.h
    trunk/numeric.c
    trunk/parse.y
    trunk/range.c
    trunk/string.c
    trunk/test/ruby/test_array.rb
    trunk/test/ruby/test_range.rb


More information about the ruby-cvs mailing list