It always pleases me when debug removes the @ and @:'s. The two examples you point to could also be defined:
f=: 13 :'x*((([:%: +)/)@:*:) y' f2=: 13 :'x * ([:(([:%: +)/)*:) y' (2 f 1 2 3)-:2 f2 1 2 3 1 g=: 13 :'x * ((%: @ (+/))@:*:) y' g2=: 13 :'x * ([:([:%: +/)*:) y' (2 g 1 2 3)-:2 g2 1 2 3 1 Linda -----Original Message----- From: Programming [mailto:[email protected]] On Behalf Of Henry Rich Sent: Saturday, December 2, 2017 1:29 PM To: [email protected] Subject: Re: [Jprogramming] APL Exercises There are no exceptions, only rules: see http://code.jsoftware.com/wiki/Vocabulary/Modifiers#Grouping_And_Order_Of_Execution Henry Rich On 12/2/2017 1:02 PM, Andrew Dabrowski wrote: > On 12/02/2017 02:17 AM, Roger Hui wrote: > >>>> SC =: 3 : '(3 3$4>i.5) ,./^:2@(*/)^:y ,.1' >>> SC confuses me. I would have thought that >>> >>> (3 3$4>i.5) (*/)^:y ,.1 >> The left operand of the power operator ^: is ,./^:2@(*/) . >> > Oh, I parsed it as > > (3 3$4>i.5) (,./^:2) @ ((*/)^:y) ,.1 > > but it should be > > (3 3$4>i.5) (,./^:2 @ */)^:y ,.1 > > is that right? I'm certainly not au courant in all the exceptions to > right-association. > > Btw, does the cut function ;._3 have an inverse that could be used to > solve this problem? > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm --- This email has been checked for viruses by AVG. http://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
