The interesting thing happening here is that $ returns a list, and an 
expectation that ^:0 (,0 looks the same) results in y unchanged.

$^:(2 -: $) 2 3

2 3

$^:(2 -: {:@$) 2 3

2

a rank 0 function (=) applied to a rank 1 argument is going to result in a rank 
1 array.

$ $ ^:(,1) 2 3

1 1

$ $^:(1) 2 3

1

 $ ^:(,0) 2 3

1 2

$ ^:(,0) 2 3

2 3



Even if the list argument (v to ^:) has only the single element 0, y must have 
a leading axis added, in order for possibly more list items in arg to add to 
result you are supposed to want with list n arg to ^: .  The behaviour is 
useful. ^:(i.n) will return a list of all of the iteration results


On Sunday, December 5, 2021, 10:41:25 a.m. EST, Marshall Lochbaum 
<[email protected]> wrote: 





I believe this should be the expected result. Calling $ on a list gives
a one-element list, which gives the result of ^: gets a leading 1 in the
shape. The value of that list's one element is 1 for the first example
and 0 in the second, causing the difference in ranks.

Marshall

On Sun, Dec 05, 2021 at 09:00:33AM -0500, David Lambert wrote:
>    JVERSION
> Engine: j903/j64avx2/linux
> Beta-v: commercial/2021-11-16T21:55:10
> Library: 9.03.05
> Platform: Linux 64
> Installer: J903 install
> InstallPath: /home/lambertdw/downloads/installs/j903
> Contact: www.jsoftware.com
> 
> 
>    $ ,:^:(2=$) 2 3
> 1 1 2
> 
>    $ ,:^:(2=$) 2 3 8
> 1 3
> 
> I recall we've seen this in earlier beta versions.
> 
> Thanks, Dave.
> 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
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