arrayutils

map/mapIt for arrays

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:23

Tags

Installation

nimble install arrayutils
choosenim install arrayutils
git clone https://github.com/choltreppe/arrayutils

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
arrayutils - - - - - - -

Source

Repository https://github.com/choltreppe/arrayutils
Homepage https://github.com/choltreppe/arrayutils
Registry Source nimble_official

README

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]