Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
mapi -> mappedi
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Aug 11, 2022
1 parent 779fac5 commit aaac707
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The attribute `eq` is TRUE if each element of the array is equal to the correspo
The attribute `without` is a new array with the i-th element removed.

The attributes `each`, `reduce`, and `map` are respectively similar to forEach, reduce, find, reduce, and map methods of Array object in JavaScript (ECMA, 2011).
A few “twin” attributes `reducedi`, and `mapi`are semantically the same, but with an extra int argument as a counter of a cycle.
A few “twin” attributes `reducedi`, and `mappedi`are semantically the same, but with an extra int argument as a counter of a cycle.
The attribute `slice` is a part of the array.

```
Expand Down
4 changes: 2 additions & 2 deletions src/main/eo/org/eolang/collections/list.eo
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# object with two free attributes. The first
# one for the element of the array, the second one
# for the index.
[f] > mapi
[f] > mappedi
list > @
^.reducei
*
Expand All @@ -85,7 +85,7 @@
# object with one free attribute, for the element
# of the array.
[f] > map
^.mapi > @
^.mappedi > @
[x idx]
&.f x > @

Expand Down
8 changes: 4 additions & 4 deletions src/test/eo/org/eolang/collections/list-tests.eo
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
x
$.equal-to -24

[] > mapi-should-works
[] > mappedi-should-works
assert-that > @
mapi.
mappedi.
list
* 1 2 3 4
[x i]
Expand All @@ -167,9 +167,9 @@
* 2 4 6 8

# this test performs mapping of list using the index for it
[] > mapi-index-can-be-accessed
[] > mappedi-index-can-be-accessed
[numbers...] > multipliedByNaturalSequence
mapi. > @
mappedi. > @
list numbers
[current index]
times. > @
Expand Down

0 comments on commit aaac707

Please sign in to comment.