immutable icon indicating copy to clipboard operation
immutable copied to clipboard

Feature Request: Allow to append/prepend multiple values

Open guenhter opened this issue 3 years ago • 2 comments

With go slices it is possible to append multiple values:

s = append(s, anotherSlice...)

This is quite cumbersome currently with immutable, and also would create a lot of unnecessary lists.

Would it be possible to add support for this?

guenhter avatar May 07 '21 10:05 guenhter

If you need to add multiple values initially, you can use the ListBuilder. I could maybe see optimizing for append/prepend on existing lists.

benbjohnson avatar May 07 '21 17:05 benbjohnson

Actually, initially the list is most of the times empty but during runtime slices of elements should be added to it. So it would be nice to have this for existing lists.

guenhter avatar May 07 '21 17:05 guenhter