This definition isn't consistent with I. on a rank 1 argument, since it
returns a shape l,1 array:

   ($#:I.@,) 0 0 1 1
2
3

If I. combined the two, functions written with the high-rank version
would usually fail in this case. Better to make the programmer remember
an idiom than to provide an incomplete version of it.

Marshall

On Mon, Oct 25, 2021 at 09:42:24AM +0100, 'Mike Day' via Programming wrote:
> I’m almost sure you already know this idiom:
>      ]x=. 0 4 5 e.~ i.3 3
> 1 0 0
> 0 1 1
> 0 0 0
>    where =: $#:I.@,
>    where x
> 0 0
> 1 1
> 1 2
> 
> ... and you know that I.x is filling in zeros in rows 0 & 2 to match the 
> length of row 1, 
> so I’ve probably missed the point!
> 
> Sadly, Roger isn’t around to explain why monadic I. doesn’t act as “where”.  
> Perhaps Henry knows.
> 
> Cheers,
> 
> Mike
> 
> Sent from my iPad
> 
> > On 25 Oct 2021, at 08:10, Elijah Stone <[email protected]> wrote:
> > 
> >   ]x=. 0 4 5 e.~ i.3 3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to