Atom is a non-array like in LISP. So it has no shape, i.e. its
shape is an empty vector. And rank of Atom, as length of
an empty shape, is 0.

Conversely, elements (rank-0 cells) of arrays can only be
atoms. To make a non-atom (rank>0 array) into another
array element it has to be boxed, and all the resulting
array is an array of boxes.

A arrays are either all boxed or all open, e.g. to
make an atom and an array elements of another array
they both need to be boxed.

   123 , < 2 3
|domain error
|   123    ,<2 3
   (<123) , < 2 3
+---+---+
|123|2 3|
+---+---+

However, arrays can be used to construct open arrays,
but they per se never become elements, whereas their 
elements are "glued" with elements of the other array
to form a bigger array, thus the words 

   , Append            ,. Stitch             ,: Laminate

   1 2 3 , 4 5        1 2 3 ,. 4 5 0         1 2 3 ,: 4 5
1 2 3 4 5          1 4                    1 2 3          
                   2 5                    4 5 0          
                   3 0               



--- Terrence Brannon <[EMAIL PROTECTED]> wrote:

> On this page we see:
> 
> <quote href="http://www.jsoftware.com/help/jforc/declarations.htm";>
> An atom is defined to have rank 0; therefore, its shape is an array with 0
> items, i. e. an empty array of rank 1.
> </quote>
> 
> My question about this quote is: why wouldn't an atom be a rank-1 array with
> 1 item of shape 1?
> 
> An array with 0 items would have no data. An atom has data. I think an atom
> is more similar to a rank-1 array with shape 1 than a rank-1 array of shape
> 0.
> 
> Continuing the the "Cells" section we see:
> 
> <quote href="http://www.jsoftware.com/help/jforc/declarations.htm";>
> A rank-3 array of shape 4 5, 6 such as the one defined in C by the
> declaration
> 
>       int q[4][5][6];
> 
> can be thought of as an array of 4 elements, each with rank 2 and shape 5 6,
> or as a 4x5 array of elements, each with rank 1 and shape 6, or as a 4x5x6
> array of rank-0 atoms.
> </quote>
> 
> And my question is: on the bolded part: why not a 4x5x6 of rank-1 atoms? But
> I think I know the answer to this. It is because a 4x5x6 array already has
> "boxes" for data on each axis and we simply need to pop "boxless" atoms in.
> 
> But understanding my second question does not make my first question any
> clearer.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 




 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to