Content deleted Content added
Added information about Microsoft BASIC 'Option Base' and corrected the default type column information for VB and VB.NET. |
Jerryobject (talk | contribs) m Cut needless whitespace character carriage returns in sections: standardize, aid work via small screens. WP:LINKs: update-standardizes, needless WP:PIPEs > WP:NOPIPEs. |
||
Line 7:
=== Array dimensions ===
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).
Line 53 ⟶ 52:
| {{Mono|len(''name'')}} || {{Mono|0}} || {{Mono|len(''name'') - 1}}
|-
| [[
| {{Mono|rangeSize (bounds ''name'')}} || {{Mono|fst (bounds ''name'')}} || {{Mono|snd (bounds ''name'')}}
|-
Line 199 ⟶ 198:
|-
| {{Mono|name''' ! '''index}}
| [[
|-
| {{Mono|'''$'''name''' ? '''index'''}}
Line 258 ⟶ 257:
|-
| {{Mono|name'''['''first'''..'''last''']'''}}
| [[Pascal (programming language)|Pascal]], [[Object Pascal]], [[Delphi (
|-
| {{Mono|'''$'''name'''['''first'''..'''last''']'''}}
Line 523 ⟶ 522:
| style="background:honeydew;" | yes
|-
| [[
| style="background:cornsilk;" | 0
| style="background:honeydew;" | yes<ref name="cr24"/>
Line 876 ⟶ 875:
== Vectorized array operations ==
Some compiled languages such as [[Ada (programming language)|Ada]] and [[Fortran]], and some scripting languages such as [[IDL (programming language)|IDL]], [[MATLAB]], and [[S-Lang (programming library)|S-Lang]], have native support for vectorized operations on arrays. For example, to perform an element by element sum of two arrays, {{Mono|a}} and {{Mono|b}} to produce a third {{Mono|c}}, it is only necessary to write
c = a + b
Line 1,006 ⟶ 1,004:
<ref name="cr5">This list is strictly comparing language features. In every language (even assembler) it is possible to provide improved array handling via add on libraries. This language has improved array handling as part of its standard library</ref>
<ref name="cr6">The class Array is fixed-size, but OrderedCollection is dynamic</ref>
<ref name="cr7">The indexing base can be 0 or 1 as per the System Variable {{Mono|⎕IO}}.
<ref name="cr8">At least 2 dimensions (scalar numbers are 1×1 arrays, vectors are 1×n or n×1 arrays).</ref>
<ref name="cr9">Allows creating fixed-size arrays in "unsafe" code, allowing enhanced [[interoperability]] with other language</ref>
|