Apparently you want to use a verb you defined to have an initialization. How about something like this?
insert2=:1 : 0 u '' u/y ) myverb=:3 : 0 echo 'Initializing' : x+y ) myverb insert2 1 2 3 Initializing 6 Since the verb would only have a dyadic use in the insert then use the monadic use to initialize and then the dyadic case for the rest of the insert. On Sun, Mar 4, 2018 at 9:00 AM, Arnab Chakraborty <arnab...@gmail.com> wrote: > Thanks, friends, for all the helpful suggestions. I am yet to try to out > all of them. Shall get back once I do. > > > > Thanks and regards, > > Arnab > > On Sat, Mar 3, 2018 at 12:39 AM, 'Pascal Jasmin' via Programming < > programm...@jsoftware.com> wrote: > > > The usefulness of the F. F: family (there will probably be just 1 or 2 > > vocabulary entries) is that they replace / and /\ when the result of > u/ > > item_of_y (with optional initial value) is a different shape than > > item_of_y. Most often it is the shape of the initial value, though with > F. > > that initial value can change to any shape as the items of y are applied > to > > it. > > > > Z: allows breaking out of such a fold when a condition is reached > (usually > > a success condition for finding what you were looking for) > > > > Z: might also be usable when wishing to exit/abort an arbitrary verb, for > > example, finding the first value that meets threshold > > > > (1 i.~ 20 < ])@:+: i.10000000 > > > > > > could become, something like > > > > >:@# Z:^:(20 <])@:+: > > > > though this needs work, and probably Z: needs to be an adverb that has > its > > abort condition as u, which might lose flexibility for its main purpose > > with F. > > > > > > > > ________________________________ > > From: Brian Schott <schott.br...@gmail.com> > > To: Programming forum <programm...@jsoftware.com> > > Sent: Friday, March 2, 2018 1:02 PM > > Subject: Re: [Jprogramming] Insert initialising > > > > > > > > Have you considered using Z and z instead of Z and F? > > And maybe using z and Z for the parallels to .: and :. although .: and :. > > might be more suggestive of the distinctions that they make. > > I frankly have a very hard time grokking all the different folds, not > > having used any at all. But I am sort of not looking forward to the > revised > > Vocabulary page with the several F's added. > > > > ---------------------------------------------------------------------- > > 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