17 ms·
Totally different typical usage patterns. Taking substrings and throwing away the original string is the norm for text. Taking a column of a matrix and throwing
by StefanKarpinski 11y ago
Totally different typical usage patterns. Taking substrings and throwing away the original string is the norm for text. Taking a column of a matrix and throwing away the original matrix is not. Different domains call for different design tradeoffs – this change stems from extensive practical experience with writing numerical algorithms.
- lqdc13 11y agowould there still be an easy way to make copies? Like advanced indexing (http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html#advanced-indexing http://docs.scipy.org/doc/numpy/reference/arrays.indexing.ht...) in the Python world?
- elcritch 11y agoYou could just use a list comprehension, e.g. `[ x for x in arrayveiw1 ]` or perhaps a copy function will be added to Base.
- StefanKarpinski 11y agoThere's already a copy function that does this.
- elcritch 11y agoGreat, Julia seems to have a good assortment of those "I need XYZ" (for scientific programming) and it's already in Base. I should check the apropos more.
- masklinn 11y agoNote that I am not saying it's a bad default (it still is the default of Erlang binaries). I am saying this change is not quite "just a matter of performance", that the documentation and changelogs should be very very clear about the behavioural changes and the possible issues with the new behaviour, and that there should be an easy way to "unshare" slices and force a copy.