Actions
Feature #15730
closedAdd map_with_index method
Feature #15730:
Add map_with_index method
Status:
Closed
Assignee:
-
Target version:
-
Description
I was converting some Ruby code to Crystal on Rosetta Code and came across this Ruby snippet,
where arry is an array of integers.
This wouldn't convert directly into Crystal (wouldn't compile).
Looking at their enumerables methods they have map_with_index, and that works.
I don't know how frequently in Ruby this method combination exits, but I suspect it's somewhat common.
I think this method makes a whole lot of logical sense, would optimize the concept, and makes reading code easier.
Anyway, thanks for any consideration.
Actions