On Wed, 4 Aug 2021, Thomas Bulka wrote:

Now I want to apply some monadic verbs to M, like:

N =: |: >: *: M

It seems to me, that the tacit way to combine the verbs |: >: *: makes heavy use of [:, which makes the tacit form pretty verbose for such a simple task:

tv =: [: |: [: >: *:

Since I seem to stumble above the need to chain some monadic verbs to process some noun quite often, I wonder what the most idiomatic J-way is to handle that kind of construct. Is it the tacit form tv from above? Is there a better tacit form? Would it be the explicit form ev =: 3 : '|: >: *: y'?

Another option is to use @:. The resulting construct has no fewer characters (depending on style), but I think it expresses intent better, and it composes more easily into larger trains.

For such a small verb, all methods seem acceptable. Context changes everything, however; if you have a sequence of monadic applications inside of a larger verb that wants to be tacit, make the whole thing tacit; if the context wants to be explicit, make the whole thing explicit.

 -E
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to