From: muraken@... Date: 2018-07-05T07:36:12+00:00 Subject: [ruby-core:87806] [Ruby trunk Feature#14697][Assigned] Introducing Range#% as an alias to Range#step Issue #14697 has been updated by mrkn (Kenta Murata). Status changed from Open to Assigned Assignee changed from matz (Yukihiro Matsumoto) to mrkn (Kenta Murata) Target version set to 2.6 ---------------------------------------- Feature #14697: Introducing Range#% as an alias to Range#step https://bugs.ruby-lang.org/issues/14697#change-72823 * Author: mrkn (Kenta Murata) * Status: Assigned * Priority: Normal * Assignee: mrkn (Kenta Murata) * Target version: 2.6 ---------------------------------------- In #13904, `Enumerator::ArithmeticSequence` has been accepted for the representation of a range with step value. And in #12912, a new syntax of endless range `(1..)` has been accepted. Combining these new features, we can write an endless step range like `(1..).step(2)` in Ruby 2.6. It can be used for array slicing like python's `1::2`. If `Range#%` is introduced as an alias to `Range#step`, we can write a step range like `(1..)%2`. This notation is already introduced numo-narray. -- https://bugs.ruby-lang.org/ Unsubscribe: