can the whole STD library be revised for enforcing explicit nulls everywhere?, including iterators and so on, this may be breaking but also one of the few appropriate moments
For ergonomics on small arrays. And orthogonality, because such match works on all other collections.
I have recently migrated Vectors to IArrays, this is how I encountered this quirk. Most of them are less than 20 elements, commonly much less. And :+ is cheaper on IArray than Vector for (my estimate) collections under 100 elements. System.arrayCopy is much more efficient than shuffling pointers around for Vector.
By the same argument, :+ (popping off last element) on List should not be supported, because it is prohibitively expensive, even more than on Array.
I think that a match like case beginning :+ a :+ b :+ c makes three linear copies of ArraySeq / Vector, which is contrary to expectation. Ideally it would just pick out last three elements and do one dropRight(3).
Or (or in addition to), we could support matches where the glob is not necessarily at the end, such as case ArraySeq(beginning*, a, b, c)
I know this is probably not necessarily a library thing but a more involved redesign, but just putting it here because we have just talked about a related topic.
Look guys, you’re not going to get your feature into the standard library by posting comments on this thread. If you want to make that happen, follow the process and make a thread for whatever it is that you’re proposing and collect feedback. Other people aren’t going to do that for you.