Hmm.. well...

Copy (with a single preceeding 0 added to the right arg) should work
for that, with a fixed left argument.

But note that the approach I suggested could also be made to work with
a fixed sized argument.

For example:
   (,a) 6 7 8 11 12 13} 20#0

(Or you could expand 20#0...).

Thanks,

-- 
Raul

On Mon, Apr 29, 2019 at 1:22 PM Brian Schott <[email protected]> wrote:
>
> Raul,
>
> My current need was to understand Copy because I had a unique situation
> where the size of a was fixed size. Your comments would help more if a was
> variable size.
>
> On Mon, Apr 29, 2019 at 11:51 AM Raul Miller <[email protected]> wrote:
>
> > (Just catching up on the weekend's email now...)
> >
> > I am going to ignore the =. here (in `b =. ,a`), because that makes
> > most of the rest of this make sense...
> >
> > It seems to me that ,(0,.~0,.0,~0,])a is going to be as concise as you
> > can get, unless J gets a "padding primitive".
> >
> > That said, if a is large, it might make sense to do some additional
> > work up front.  For example:
> >
> >    (,a)  (,((#,a)+(i.#a)*#a)+i.$a)}  0#~*/2+$a
> > 0 0 0 0 0 0 10 11 12 0 0 13 14 15 0 0 0 0 0 0
> >
> > (But I'd still want to benchmark that before I declared it "more
> > efficient".)
> >
> > Thanks,
> >
> > --
> > Raul
> >
> > --
> (B=)
> ----------------------------------------------------------------------
> 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