4 ms·
40 years ago that would have been true, but meaning has since shifted. Hence the last statement in my response, which you ignored.
by relaxing 2y ago
40 years ago that would have been true, but meaning has since shifted. Hence the last statement in my response, which you ignored.
- layer8 2y agoThat's the usage in JavaScript, but there has been no general shift. What I wrote is true in Java, Go, Rust, and Python, for example. In theoretical computer science, it is certainly the default assumption when the word "array" is used without qualification. See also https://en.wikiversity.org/wiki/Data_Structures_and_Algorithms/Arrays,_Lists_and_Vectors https://en.wikiversity.org/wiki/Data_Structures_and_Algorith... Or see the use of arrays in "Introduction to Algorithms", one of the standard textbooks about algorithms and data structures, the current edition being from 2022. There is no notion of arrays being resizable there.
- rafram 2y agoBut not PHP (where an array is actually a dictionary, too...), Perl, Swift, or most scientific languages like Matlab and R. C-influenced languages usually differentiate between "arrays" and "lists"/"vectors", but that's just convention. Java, of course, calls its standard general-purpose list implementation both "array" and "list."
- reshlo 2y ago> C-influenced languages usually differentiate between “arrays” and “lists”/“vectors” On that note, Swift is in the process of introducing a fixed-size array type which they intend to call “Vector”.
- layer8 2y agoJava doesn’t call any of its List implementations “array”. There’s ArrayList, which just means a list implemented on top of an array (actually multiple arrays in the general case, since it has to switch between arrays when increasing capacity). It doesn’t mean that it is an array, any more than a stack implemented on top of an array is an array (it isn’t).