When you pass a range to select, the begin and end are indexex or the way that human count?
ary = [1, 6, 2, 4, 8]
ary.select!(3..7) # if the end beyond the size, is it loop to begin of the array?
ary # => [6, 4], to me [1, 6] looks like more meaningful 😥
``
I do agree that it’s a bit confusing. Maybe we should remove select! and reject! with patterns and instead use grep, which already exists, and also add grep_v (like in Ruby).
While #grep and #grep_v might be more understandable to some programmers (who are familiar with Linux), select and reject are much more clear in terms of simple English language readability. One of my favorite things about Crystal is that it’s easy to read, and I think this is a situation in which clear documentation (which I think we already have for these methods) is better than making the method names more technical.
I don’t think taking UNIX commands will produce a good API for a general purpose programming language.
Generally, plain English is more descriptive about the action.
There is already select(pattern), we could remove grep(pattern) if we follow the least aliases principle.