The reason it's hard to find anything else on modifier trains is that they have been removed from the language a long time ago (with j501 in 2002, apparently), and only reintroduced recently with j903.
Before the reintroduction, the only modifier trains were bidents: - partially applied conjunctions, yielding adverbs; and - chained adverbs, being applied to their left argument in order. They were left over because they are simple, intuitive and easy to remember (guessing here, as I wasn't around in the J scene yet). These are explained well in https://www.jsoftware.com/help/learning/15.htm . The adverbs each and every defined in the standard library library are useful examples of the first kind of bidents: type&.<'each' adverb each &.> The rabbit hole of general modifier trains is deep: they are not completely intuitive (at least to me) and require a thorough understanding of the parsing and execution in J, especially when chaining more than three. They are also not indispensable, as you can write explicit conjunctions and adverbs to do anything such tacit modifiers would do. I have yet to find a useful, non-trivial purpose for them... Of course, feel free to use them if you like the challenge, but there are far more important areas to get to know in J, like rank. Or all the wonderful labs (in the menu, help > studio > labs). Good luck on your journey! Jan-Pieter Op wo 15 feb. 2023 om 04:36 schreef More Rice <mrmorer...@gmail.com> > Thank you for taking the time to explain at the level you knew I could > digest. It is really helpful - I can now use @ vs @: in very practical > ways. > > And the bonus ... > > The myvarp3 is so much more readable I wondered why I never came across > such construction. It puzzled me the entire night as to what I'm looking > at. > > In NuVoc, conjunction's behaviour is described with both left and right > operands present. I have never seen one of their operands missing in their > description (as to what this case they would do). The closest thing I > found in the end is this: > https://code.jsoftware.com/wiki/Vocabulary/ModifierTrains > > "A0 A1" (my guess for myvarp3) is just one of many possibilities to > construct trains. > > It is a beautiful discovery. > > Unfortunately the material written there is too advanced for a Journeyman > like me. I couldn't find any J book/pdf that talks about it in a more > digestible way ... and the j wiki only has this page. > > But I'm really excited about this discovery. > > thank you. > > Maurice > > > > > On Sun, Feb 12, 2023 at 6:58 PM 'Pascal Jasmin' via Programming < > programm...@jsoftware.com> wrote: > > > All conjunctions including @ bind to their right argument "tightly" > > meaning just the one token. > > > > The left argument of conjunctions/adverbs is the entire verb phrase to > the > > left of it. > > > > myvarp1 uses "linear style" even if it is tacit. `[:` has "no binding" > > everything to right will execute first, and whatever is to left will wait > > until that provides a result before the left of [: "composes" with the > > right. > > > > @:, by the way, is more strictly equivalent to [:/"linear style" by > > ensuring that composition occurs on the full result of the "right > > expression". (+/@:) will apply to full "result" of the v argument to @: > . > > The sum of the full result requires @: > > > > A style that permits shorter parentheses groups with less nesting for > > conjunctions meant to operate on a long expression to the right, the way > @, > > @: do when "emulating linear style" is to turn the conjunction into an > > adverb, placing it to the right of the "right expression". so, > > > > myvarp3 =: (- +/ % #)(*:@)(+/@:) % # > > > > > > > > On Sunday, February 12, 2023 at 04:46:35 p.m. EST, More Rice < > > mrmorer...@gmail.com> wrote: > > > > > > > > > > > > Masters, > > > > I understand that there is an excellent reference implementation of varp > in > > addons/stats/base/univariate.ijs to learn from, but I'm trying to do > > exercises to solidify my understanding of using verb trains/hooks, and > the > > difference when using Atop. > > > > I've 2 versions of varp. > > > > #1 below is typical of what some of you do (credit: Bob's "Maximum > > Consecutive 1's in J." Excellent video! Thank you. I wish there were > more > > of these.) - using cap when we want to string monadic verbs sequentially. > > No problem there. > > > > NB. works - using hook/fork/cap > > myvarp1 =: # %~ [: +/ [: *: (-+/%#) > > > > NB. works - using hook/fork/Atop and no cap > > myvarp2 =: # %~ +/ @ (*: @ (-+/%#)) > > > > > > #2 above, for some reason, I need an extra pair of parentheses to the > right > > of the 1st @ for it to work. I don't get why. For example, the following > > is broken. > > > > NB. It gives me a list instead :( > > > > myvarp_broken =: # %~ +/ @ *: @ (-+/%#) > > > > > > Why are they (the missing parentheses w.r.t. #2) needed? > > > > > > > > thank you > > Maurice > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm