Array model: Difference between revisions

Jump to navigation Jump to search
43 bytes added ,  20:42, 18 September 2019
no edit summary
Miraheze>Adám Brudzewsky
(Created page with "APL uses a uniquely versatile array model, much more powerful than the [linked lists](https://en.wikipedia.org/wiki/Linked_list) of many traditional programming languages like...")
 
Miraheze>Adám Brudzewsky
No edit summary
Line 16: Line 16:


=== Depth ===
=== Depth ===
{{Main|Depth}}
 
''Main article: [[Depth]]''
 
The depth is the level of nesting. For example an array of simple (i.e. non-nested) scalars has depth 1, an array containing only depth 1 arrays has depth 2 and a simple scalar (e.g a number or character) has depth 0. However, for some arrays it's not so easy. An array may contain both vectors and scalars. In cases like this, the depth is reported as negative.
The depth is the level of nesting. For example an array of simple (i.e. non-nested) scalars has depth 1, an array containing only depth 1 arrays has depth 2 and a simple scalar (e.g a number or character) has depth 0. However, for some arrays it's not so easy. An array may contain both vectors and scalars. In cases like this, the depth is reported as negative.
You can find the depth of an array with the function <code>≡</code>.
You can find the depth of an array with the function <code>≡</code>.


=== Rank ===
=== Rank ===
''Main article: [[Rank]]''
The concept of rank is very important in APL, and isn't present in many other languages. It refers to the number of dimensions in the array. So far, rank-0 arrays are scalars, rank-1 arrays are vectors, rank-2 arrays are usually called matrices or tables.
The concept of rank is very important in APL, and isn't present in many other languages. It refers to the number of dimensions in the array. So far, rank-0 arrays are scalars, rank-1 arrays are vectors, rank-2 arrays are usually called matrices or tables.


== External links ==
== External links ==
[http://help.dyalog.com/latest/Content/Language/Introduction/Variables/Arrays.htm Formal definition)
[http://help.dyalog.com/latest/Content/Language/Introduction/Variables/Arrays.htm Formal definition]


[https://chat.stackexchange.com/rooms/52405/conversation/lesson-1-introduction-to-arrays-in-apl Chat lesson)
[https://chat.stackexchange.com/rooms/52405/conversation/lesson-1-introduction-to-arrays-in-apl Chat lesson]


[http://help.dyalog.com/latest/Content/Language/Introduction/Variables/Vector%20Notation.htm Vector notation)
[http://help.dyalog.com/latest/Content/Language/Introduction/Variables/Vector%20Notation.htm Vector notation]

Navigation menu