No description
Find a file
2025-03-25 22:29:26 +01:00
src add concat operator 2025-03-25 22:29:26 +01:00
tests add concat operator 2025-03-25 22:29:26 +01:00
arrayutils.nimble add concat operator 2025-03-25 22:29:26 +01:00
LICENSE.md add license 2023-11-20 00:10:35 +01:00
README.md add concat operator 2025-03-25 22:29:26 +01:00

map proc


echo [1, 3, 5].map do (x: int) -> string: $(2*x)

# works with any index type
echo ['a': 1, 'b': 3, 'c': 5].map do (x: int) -> string: $(2*x)

mapIt template

echo [1, 3, 5].mapIt($(2*it))
echo ['a': 1, 'b': 3, 'c': 5].mapIt($(2*it))

& operator

the same as for seq and string

assert [1, 2, 3] & [4, 5] == [1, 2, 3, 4, 5]
assert 1 & [3, 3, 7] == [1, 3, 3, 7]
assert [1, 3, 2] & 6 == [1, 3, 2, 6]