motoko-base
motoko-base copied to clipboard
Overload append to also take array (or initialize fromIter)
for the sake of dx
Moved to the right repo. Could you please add some more information? Such as which append
you are talking about.
Oh thanks, sorry I thought it was in the portal (I used the link from the bottom of the page of the docs).
Oh and I apologize for the ambiguity of the original post. I think I was trying to suggest something more general (ie a similar pattern/behavior for other collections as well), but specifically when it comes to Buffer
we have func append(b : Buffer<X>)
when often times it is also useful to create or fill/append from an existing array, so that Buffer
could also have appendFromArray
or if there is a way to parameterize collections something like appendFromIterable<I>
since this, at least in my experience, is common functionality that could help when working with buffers.
Apologies again about the original post's ambiguity.