I cannot imagine either what that business might be.  Neither I can find
any warning in the dictionary justifying this behavior.  On the contrary:
"If n is negative, the *obverse* u^:_1 (see below) is applied |n times."
( http://jsoftware.com/help/dictionary/d202n.htm )

There are potential adverse performance consequences;  for example,
((u(^:_1) (^:2) vs. (u(^:_2)).  But what I find most disturbing is that
this behavior contradicts my understanding of the quoted dictionary's
statement:

   u=. [: :. >:
   ((u^:_1)^:2) 0
2
   (u^:_2) 0
|domain error: u
|       (u^:_2)0







On Tue, Jul 15, 2014 at 11:57 AM, <[email protected]> wrote:

> u^:_1 executes the inverse of u, but u&:_2, or any other value
> of n containing a negative value, executes u first.  I am just wondering
> why
>
>   '' [ (>:@[ smoutput@('+',":)) :. (<:@[ smoutput@('-',":)) ^:(_1) 0
> -0
>
>   '' [ (>:@[ smoutput@('+',":)) :. (<:@[ smoutput@('-',":)) ^:(_1 0) 0
> +0
> -0
>
>   '' [ (>:@[ smoutput@('+',":)) :. (<:@[ smoutput@('-',":)) ^:(_2) 0
> +0
> -0
> -_1
>
> The +0 lines are the surprise executions of u.  The execution seems to
> mean business:
>
>    [: :. (smoutput@('inverse ',":))^:_1  'abc'
> inverse abc
>    [: :. (smoutput@('inverse ',":))^:_1 _1  'abc'
> |domain error
> |       [: :.(smoutput@('inverse ',":))^:_1 _1'abc'
>
> I just can't imagine what the business might be.
>
> Henry Rich
>
>
> ----------------------------------------------------------------------
> 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