[#86787] [Ruby trunk Feature#14723] [WIP] sleepy GC — ko1@...

Issue #14723 has been updated by ko1 (Koichi Sasada).

13 messages 2018/05/01
[#86790] Re: [Ruby trunk Feature#14723] [WIP] sleepy GC — Eric Wong <normalperson@...> 2018/05/01

ko1@atdot.net wrote:

[#87095] [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — ko1@...

Issue #14767 has been updated by ko1 (Koichi Sasada).

9 messages 2018/05/17
[#87096] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — Eric Wong <normalperson@...> 2018/05/17

ko1@atdot.net wrote:

[ruby-core:87129] [Ruby trunk Feature#14697] Introducing Range#% as an alias to Range#step

From: shevegen@...
Date: 2018-05-17 10:08:02 UTC
List: ruby-core #87129
Issue #14697 has been updated by shevegen (Robert A. Heiler).


I personally am not hugely comfortable with endless Range, but I understand
the reasoning given by mame for it. There is nothing shorter than omission
of characters. :D

Since endless Range was accepted, I think using % on Range, as explained by
mrkn, makes sense too. I personally like step more because it tells me 
more (somewhat similar reason for as to why I prefer to not omit an end
range in the ruby code that I write), but I think since endless Range was
accepted, accepting the issue request here makes sense too. (I am not sure
if anyone understood what I was trying to say, but in short, +1 to the
issue request.)

Ruby allows for different paradigms and writing styles and people can 
always decide for their own how (and what) to write/code anyway.

----------------------------------------
Feature #14697: Introducing Range#% as an alias to Range#step
https://bugs.ruby-lang.org/issues/14697#change-72114

* Author: mrkn (Kenta Murata)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next