Linda,

I am going to take a stab at answering your question, just to see if I am
right, assuming others will correct me.

I believe : is a conjunction and thus tries to take as many left arguments
as it can before executing. In this case the right-most : needs to execute
before the left-most one is executed, but if the right-most receives
another operator before it executes, it tries to incorporate that new
conjunction first. So the parens or your assignment to A force the order
needed.



On Sun, Dec 8, 2013 at 3:52 AM, Linda Alvord <[email protected]>wrote:

> Raul,  Here's what you wrote.  I didn't understand the parentheses.
>
>    a=:%
>    l=:i.3
>    t=:i:3
>
>    f=: 1 :(':';'x u /y')
>    l a f t
>         0    0  0 0 0   0        0
> _0.333333 _0.5 _1 _ 1 0.5 0.333333
> _0.666667   _1 _2 _ 2   1 0.666667
>
> So I wrote function which also works and I also don't understand it.
>
>
>    g=: 1 :A=:':';'x u /y'
>    l a g t
>         0    0  0 0 0   0        0
> _0.333333 _0.5 _1 _ 1 0.5 0.333333
> _0.666667   _1 _2 _ 2   1 0.666667
>
>
> If I remove   A=:  it no longer works!  What is happening here to make g
> work correctly AND h fail?
>
>
-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to