> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of R.E. Boss
> Sent: Saturday, October 13, 2007 1:47 PM
> To: 'General forum'
> Subject: RE: [Jgeneral] paradoxes - (2) Behead (1) arrays
> 
> 
> 
> > -----Oorspronkelijk bericht-----
> > Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> > Namens Henry Rich
> > Verzonden: zaterdag 13 oktober 2007 17:26
> > Aan: 'General forum'
> > Onderwerp: RE: [Jgeneral] paradoxes - (2) Behead (1) arrays
> > 
> > The key concept is that of 'item'.  An array (no, wait, a
> > non-atomic array) is a list of its items.  Many of J's
> > primitives treat the items as unbreakable.
> > 
> > }. removes the first item.  That leaves 0 items.  The
> > shape of an item remains unchanged, but there are still
> > 0 of them.
> > 
> (...)
> 
> So obviously there are 0 items:
> 
>    # i.0 2 3
> 0
> 
> But what about
> 
>    {. i.0 2 3
> 0 0 0
> 0 0 0
> 
> Is this the first (and last) of 0 items?

Almost.  A 2x3 table has 6 atoms.  A 0x2x3 array is a list
of 0 such tables.  When you ask for the first item, you
are asking for something that doesn't exist (and in earlier
releases you would get an error).

But Roger has kindly extended the definition of {. to give
you an item of fills in that case.  You are not getting an item
of y, but a fill-cell with the shape of an item of y.

Henry Rich



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to