I'm rather new to the J programming language and I have a question about equivalent tacit expressions in J.
I found two lines of J that were equivalent, but the conjunction in the code (^:)'s arguments were switched using the bracket operators.
I was mainly wondering how this expression:
u ^: x y
is equivalent to this expression:
x u @] ^: [ y
I would appreciate any J programmers to explain how the two are equivalent.
I think that the way to look at this is to look at the tacit expression
u@] ^: [as a verb formed by the conjunction^:between the two verbsu@]and[.u@]is going to take the right argumenty(to the exclusion of the left argument) and apply the monadic form ofutoy.[is going to use the left argumentxas the value that will provide the number of repetitions ofuas an operator of^:.For the explicit version,
u ^: x yreplaces the[and]verbs with their associated left and right arguments and sincexis an operator of^:,u ^: xis effectively a monadic verb withyas its argument.Let's set