Yes. The general case, implementated in J, would be more like
>(, <@u)^:n But, also, if side effects are involved, then computational efficiency of the ^: implementation will often not be the key priority. And... copying is one of the faster operations that computers support. Not the fastest, but still pretty fast. Anyways, ... if the situation is complicated enough that you might need unanticipated copy operations, it's probably (not guaranteed, but still likely) complicated enough that copying will be faster than recomputing. Thanks, -- Raul On Wed, Mar 4, 2020 at 9:15 AM Henry Rich <[email protected]> wrote: > (,u)^:n is a clever form. It does do a lot of copying, which is what > the JE design is trying to avoid; and if u returns a list it will > produce a list rather than a table. > > I think it's harsh to say that the code with restarts is not 'working > right'. It just has the side effect. I agree that it would be better > without the side effect, and I think that's feasible. > > Henry Rich > > On 3/4/2020 7:33 AM, Raul Miller wrote: > > And if you do need to keep the results, something like (,u)^:n would do > it... > > > > That said, I hope the other forms are fixable and get fixed to work > > right. (Working correctly should take precedence over working fast, > > and in the extreme cases where that's a significant problem, that just > > means you need a different facility which has a different design for > > "working correctly".) > > > > Thanks, > > > > > -- > This email has been checked for viruses by AVG. > https://www.avg.com > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
