3 ms·
The underscore is fairly pleasant to read: [1,2,3].map{_*2} I think that's what Scala has. For multi-args, perhaps: [1,2,3].reduce{_1+=_2}
by vorg 8y ago
The underscore is fairly pleasant to read:
[1,2,3].map{_*2}
I think that's what Scala has. For multi-args, perhaps:
[1,2,3].reduce{_1+=_2}
- vidarh 8y agoUnderscore is very commonly used to signifiy "I don't care about this argument" in Ruby, so at least on it's own it'd be confusing, and _1 is a valid local variable name, so would risk breaking existing code, though I've personally not seen it used, so maybe it'd be an acceptable risk.