[Jprogramming] Re: How to do that in J?
Henry Rich
HenryHRich at nc.rr.com
Wed Apr 19 09:41:56 HKT 2006
My memory is that amend is not in-place on boxed
arrays, but I can't find confirmation of that in the Dictionary.
Can anyone?
Henry Rich
> -----Original Message-----
> From: programming-bounces at jsoftware.com
> [mailto:programming-bounces at jsoftware.com] On Behalf Of Mark
> D. Niemiec
> Sent: Tuesday, April 18, 2006 9:29 PM
> To: programming at jsoftware.com
> Subject: [Jprogramming] Re: How to do that in J?
>
> "Miller, Raul D" <rdmiller at usatoday.com> wrote:
> Re: How to do that in J?
> > Mark D. Niemiec wrote:
> > > memory =: register address } memory
> > > do not actually copy the entire memory array
> >
> > Perhaps.
> >
> > I'm seeing well over an order of magnitude
> > difference in timing for operations matching
> > the above pattern. I don't really know what
> > is going on.
>
> A few things can force a copy.
> For one, if the pattern is not recognized as
> y =: x m } y
> (or =.)
> In particular, while x and m can be sophisticated
> expressions, both occurrances of y must be unadorned.
>
> Another is if a type conversion is required,
> such as amending an integer array with a real
> value.
>
> A third could happen if the two y's here are
> in different scopes (this can happen with =.
> if a global y exists but a local one does not
> exist yet - the first such amend ought to
> create a local copy).
>
> -- Mark D. Niemiec <mniemiec at interserv.com>
>
> ----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list