Creating an Array: Difference between revisions

Content added Content deleted
(deprecated task)
Line 485: Line 485:
9 25 64 49</lang>
9 25 64 49</lang>
==[[J]]==
==[[J]]==
"Creating an array" is topic seldom discussed in J as ''every'' verb takes array argument(s) and returns an array result (that is, ''everything'' creates an array). For example:
"Creating an array" is topic seldom discussed in J as all data in J is an array, and every verb takes array argument(s) and returns an array result. For example, in J, the value '''3''' is an array with zero dimensions where the value '''4 5''' is an array with one dimension (this list has 2 elements), as is the empty string '''<nowiki>''</nowiki>''' (this list has 0 elements).

Here are some additional examples:


<lang j> a=: 3 4 $ 3 1 4 1 5 9 2 6 5 3 5 8 NB. make a 3-by-4 table
<lang j> a=: 3 4 $ 3 1 4 1 5 9 2 6 5 3 5 8 NB. make a 3-by-4 table