Closed ZenVoich closed 11 months ago
Any feedback would be appreciated)
Anything?
The more general signature seems okay to me because it's still possible to pass a Nat
without any additional conversions (example). The +/- convention is reasonably intuitive for developers familiar with Python or JS.
Also, do we want a version for mutable arrays too?
+1
Also, do we want a version for mutable arrays too?
+1
Looking at the module api, I see that most (but not all) operations only operate on immutable arrays. Instead of adding a mutable variant of just this operation ( takeVar
or takeVarArray
?), perhaps we should consider later adding a new module VarArray
with mutable versions of all relevant operations (VarArray.take
, VarArray.filter
etc).
So I'd say let's just merge this immutable Array.take
for now until we find a suitable name or home for the mutable version.
We already have some historically inconsistent naming that it would be nice to resolve, eg Blob.fromArrayMut
(not Blob.fromVarArray
).
Takes N elements from the start or end of the array