I was just wondering if J has something equivalent, not asking for a language extension. Key, as suggested by Mike, can be used to achieve a similar effect (just not quite the same).
As for a[x] +=: a[x], I wonder what implementation would be more useful : - creating a temporary array with a[x] and then going ahead with the + - doing the additions in place using the elements of x in catenated row-order On Sun, Nov 3, 2019 at 8:49 PM Henry Rich <[email protected]> wrote: > I'd say that scratches the surface. > > First you would have to define something akin to a[x], which is not J > syntax. > > Then you would have to decide what assignment to a[x] means when x has > repeated indexes. > > Then you would have to decide what a[x] +=: y means when x has repeated > indexes. Does it impose an order of operations? Do you insist that it > work atom by atom, as if we were running on a 68000? > > What would a[x] +=: a[x] give? > > What about a[x] +=: a[a[x]] ? In what order are the updates to a to be > made? > > I think you would end up leaving a large part of the spec undefined. > That might be OK is the defined bit is very useful. > > hhr > > > > > On 11/3/2019 8:08 PM, Raul Miller wrote: > > Two tricks here: > > > > (1) Designing the altered parser table to handle this case (without > > breaking existing code), and > > > > (2) implementing it. > > > > > -- > 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
