Hi,
In message "Re: select and select"
on 02/09/20, dblack / candle.superlink.net <dblack / candle.superlink.net> writes:
|Maybe it would seem a better fit if the two were combined?
| arr.select {|s| s == "c"} # ["c"]
| arr.select(0,2,4) # ["a", "c", "e"]
| arr.select(0,2,4) { |s| s == "c" } # ["c"]
Hmm, from this combination,
arr.select {|s| s == "c"}
can be considered as
arr.select() {|s| s == "c"}
i.e.
arr.select(*[]) {|s| s == "c"} # [] ???
Of course, current behavior has this too, but would combination
emphasize wierdness?
|I think I would still like this better:
|
| arr.at(0,2,4).select { |s| s == "c" }
I admit this is better in some aspect.
Does "at" takes multiple placement make you feel natural?
And is this natural for Hashes?
matz.