On Mon, May 11, 2009 at 8:08 AM, Brian Schott <[email protected]> wrote:
> Yes, I get your result and another anomaly when x is shortened on Mac OS X.
>
>   x =: 1 2 3 4
>   x ({~)^:n y    NB. Seems to behave as if (n -: a:)
> |index error
> |   x    ({~)^:n y

But that is how it is supposed to work:

   4 { x
|index error
   4 { 1 2 3 4 _1
_1
   1 2 3 4 _1 ({~)^:a: y
0 1 2 3 4 _1

The problem is that, with n=:<3
   1 2 3 4 _1 ({~)^:n y
should give the result:
0 1 2 4 _1

I believe n=:<,3 should give the same result,
but it does not.  (The dictionary says that n
must be an atom but does not say that the
contents of the box must be an atom -- and,
clearly, in the case  of a: it is not an atom.)

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

Reply via email to