Thanks, Rob and Raul,
I was using ((_2: {. 1: , $)$ ,@])
which seemed too long (and would have failed for fee=:'a')
In the context of use, the only arguments that come along
will be rank 1 or 2. But I would want i. 5 2 to be left unchanged.
On 2015.10.03 11:52:03, you,
the extraordinary Rob Hodgkinson, spake thus:
>
> Sure, was only written to deal with typical input of 1 row rank 0, 1, 2
> arrays.
>
> You are right about general case, thanks Raul.
>
>
> > On 3 Oct 2015, at 11:49 am, Raul Miller <[email protected]> wrote:
> >
> > Er...
> >
> > mat=:((_2{. 1 1,$) $ ])
> > $mat i.5 2
> > 5 2 2
> >
> > ... maybe not quite that, at least not for this case?
> >
> > Thanks,
> >
> > --
> > Raul
> >
> > On Fri, Oct 2, 2015 at 9:48 PM, Rob Hodgkinson <[email protected]> wrote:
> >> Further to Bill’s point Nollaig, your approach using rank fails for a rank
> >> 0 item …
> >>
> >> $ ,:`]@.(<:@$^:2 fee) fee=:'ab'
> >> 1 2
> >> $ ,:`]@.(<:@$^:2 fee) fee=:,'a'
> >> 1 1
> >> $ ,:`]@.(<:@$^:2 fee) fee=:'a'
<snip!>
--
Nollaig MacKenzie
http://www.yorku.ca/nollaig
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm