> doU =: 1 : 'u y' > + doU/\ 1 2 3 > |domain error Once upon a time, this would have been a 'valence error'.
The problem here is that the result of doU is a monadic-only verb. Its dyadic definition is empty. But you are trying to use that result as a dyadic verb. Or, more simply: 1 +doU 2 |domain error I hope this helps, -- Raul On Tue, Jun 2, 2020 at 7:50 AM 'Pascal Jasmin' via Programming <[email protected]> wrote: > > I call explicit adverbs that don't refer to x or y semi-tacit. These have > all of the advantages of a tacitly written adverb: Result of bound adverb is > tacit and ambivalent. Can be considered "compiled". > > The most important advantage of tacit/semi-tacit adverbs is that they can > "remain non-nouns" after being bound. A fully explicit modifier is a verb > that can just take an extra noun/verb argument. For example > > > insert =: 1 : 'u/ y' > scan =: 1 : 'u\ y' > doU =: 1 : 'u y' > > There is some inconsistency in that J will "do what you mean" for some of > these but not all. > > > + doU/\ 1 2 3 > |domain error > > but > > + insert scan 1 2 3 > 1 3 6 > > +insert doU scan 1 2 3 > > 1 3 6 > > > Basically, some combinations of explicit modifiers will fail when part of a > train of modifiers. Some won't. Not sure what rules are, though perhaps > explicit definitions have some " 13 : " like functionality if they are > simple enough. > > > On Monday, June 1, 2020, 10:49:46 p.m. EDT, Henry Rich <[email protected]> > wrote: > > > > > > Not responding to your questions. > > There was, in J4 long ago, a beautiful language of tacit modifiers. I > never found a modifier I needed that I couldn't write tacitly. JfC had > a rapturous chapter about it. > > Who used it? Who understood it? I think I can tell you: > > Roger, Pepe, Raul, Dan (Bron), Martin (Neitzel), and I. (Pascal wasn't > around then.) > > In J5 Roger euthanized it. (Actually, his scalpel slipped and he left > it in a permanent vegetative state.) I wept. Then I got over it. > Others still attend at the bedside; I admire their fidelity. > > The important facts are: > > * there is nothing you can do with the tacit-modifier language that you > can't do explicitly > * the explicit form is much easier to understand > * the modifier step is never important for performance, because it > happens before the verbs get executed. > > Now that the task of maintaining the JE has fallen to me, I am glad > Roger did what he did, because having all those needless forms would > slow down parsing and add to the number of special cases involved. > > Get a copy of the J4 Dictionary and study the parser as an exhibit of > Ken mastery of computational forms. Then fuggedaboutit. Your onsub is > fine. > > Henry Rich > > On 6/1/2020 10:30 PM, Hauke Rehr wrote: > > I usually do tacit programming with J, > > but what I mean by this is I don’t use x or y > > that is I can write tacit _verbs_ only. > > I know one can be tacit on modifier level etc > > but I didn’t ever learn how. > > > > 1. is there any good place to start learning? > > if not, would anyone mind putting together > > some material on this? > > 2. here is an example of something that in terms > > of data manipulation is not very J-ish > > but let’s assume I need to do it this way > > for some reason: > > onsub =: 2 : 'n&{. , n&}.@:(n&{."1) ,. u@:(n&}."1)@(n&}.)' > > ( > > first I wrote it as an adverb without all the 'n&' parts, > > then I generalized by adding them – it’s repetitive > > but it does what I want it to do > > ) > > usage is like > > |. onsub 2 mat =: ? 5 6 $ 20 > > reversing (mirror) the 3 by 4 lower right submatrix > > > > (a) how to write this without reference to u or n? > > (b) what if I wanted to use it like this: > > (|.;#) onsub 2 mat > > with the result like everything happening in onsub > > after application of u will work on its >@{. > > and after everything is done its }. will be ;ed. > > > > btw feel free to alter this thread’s subject, I just don’t know > > what direction this will take so I picked the broad 'tacit' key > > > > > > > -- > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
