我想在映射例程中使用数组的索引。例如,这个 Raku 代码:
raku -e 'my @a = "First", "Second", "Third", "First"; say @a.map({ "Index of $_ is: ;" })'
印刷:
(Index of First is: ; Index of Second is: ; Index of Third is: ; Index of First is: ;)
是否可以获取数组的索引,例如:
(Index of First is: 0; Index of Second is: 1; Index of Third is: 2; Index of First is: 3;)
谢谢!