motoko-base icon indicating copy to clipboard operation
motoko-base copied to clipboard

Overload append to also take array (or initialize fromIter)

Open atengberg opened this issue 2 years ago • 2 comments

for the sake of dx

atengberg avatar Jul 01 '22 21:07 atengberg

Moved to the right repo. Could you please add some more information? Such as which append you are talking about.

sesi200 avatar Jul 04 '22 06:07 sesi200

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.

atengberg avatar Jul 08 '22 12:07 atengberg