Comparison of programming languages (array): Difference between revisions

Content deleted Content added
Citation bot (talk | contribs)
Add: title. Changed bare reference to CS1/2. | Use this bot. Report bugs. | Suggested by BrownHairedGirl | Linked from User:BrownHairedGirl/Articles_with_bare_links | #UCB_webform_linked 172/1154
Line 10:
The following list contains [[programming language syntax|syntax]] examples of how to determine the dimensions (index of the first element, the last element or the size in elements).
 
Note particularly that some languages index from zero while others index from one. At least since [[Edsger W. Dijkstra|Dijkstra's]] famous essay,<ref>{{Cite web|url=https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html|title = E.W. Dijkstra Archive: Why numbering should start at zero (EWD 831)}}</ref> zero-based indexing has been seen as superior, and new languages tend to use it.
 
{| class="wikitable sortable"
Line 72:
|-
| [[Lua (programming language)|Lua]]
| {{Mono|#''name''}} || {{Mono|1 by convention; any integer<ref>{{Cite web|url=https://www.lua.org/pil/11.1.html|title=Programming in Lua : 11.1}}</ref>}} || {{Mono|#''name''}}
|-
| [[Mathematica]]
Line 81:
|-:
| [[Nim (programming language)|Nim]]
|{{Mono|''name''.len}} || {{Mono|''name''.low}}<ref name="nim-lang.org">{{Cite web|url=https://nim-lang.org/docs/tut1.html#advanced-types-arrays|title=Nim Tutorial (Part I)}}</ref> || {{Mono|''name''.high}}
|-
| [[Oberon (programming language)|Oberon]]
Line 212:
| [[J (programming language)|J]]
|-
| {{Mono|name.item(index) or name @ index<ref>{{Cite web|url=http://smarteiffel.loria.fr/libraries/api/lib.d/storage.d/loadpath.se.d/collection.d/ARRAY/ANY.html|title=Eiffeldoc : ARRAY}}</ref>}}
| [[Eiffel (programming language)|Eiffel]]
|}
Line 609:
| style="background:honeydew;" | yes<ref name="nim-lang.org"/>
| style="background:honeydew;" | yes
| style="background:honeydew;" | optional<ref>{{Cite web|url=https://nim-lang.org/docs/nimc.html|title = Nim Compiler User Guide}}</ref>
| style="background:cornsilk;" | array of array<ref name="cr2"/>
| style="background:honeydew;" | yes
| style="background:honeydew;" | yes<ref>{{Cite web|url=https://stackoverflow.com/questions/53084192/r-style-logical-vector-operation-in-nim|title=Vectorization - R-style logical vector operation in Nim}}</ref>
|-
| [[Oberon (programming language)|Oberon]]