|
|
|
|
|
by tuetuopay
1006 days ago
|
|
You don't need to go the python or ruby route to get such benefits. I daily write rust that has a pretty comprehensive iterator system, while still getting the nitty-gritty in your hands. As some other commenter put it, `x.iter().map(function).collect()` is mentally translated to "apply function to the collection x" at a glance. between var y []int
for _, x := range x {
y = append(y, function(x))
}
and let y = x.iter().map(function).collect();
I'll take the second form any day. You express the flow of information, and think about transformations to your collections. |
|