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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Mark > D. Niemiec > Sent: Tuesday, April 18, 2006 9:29 PM > To: [email protected] > Subject: [Jprogramming] Re: How to do that in J? > > "Miller, Raul D" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
