Quantcast
Channel: Ruby Issue Tracking System: shevegen (Robert A. Heiler)
Viewing all articles
Browse latest Browse all 100

Ruby master - Feature #16446: Enumerable#take_*, Enumerable#drop_* counterparts with positive con...

$
0
0

I have not thought about the proposal here quite much so far, sorry (and admittedly I may need
to do so on a fresh morning as I am a bit tired).

Just two brief comments:

  • Some of the examples remind me a bit of .select/.reject/.filter. Personally I try
    to favour .select whenever possible, largely because I like positive selection/filtering.

  • To your statement "In such use cases, it is more natural to describe the condition
    in positive terms (i.e., zero?) rather than negative terms (i.e., nonzero?)".

Yup, completely agree with you there. We may have to include cases that do not have a
clear decisive difference, though, such as .odd? and .even? for numbers, and perhaps
other elements similar to this.


Viewing all articles
Browse latest Browse all 100

Trending Articles