You have nested tacit verbs within your explicit verb. You need to be able to recognize those verbs and what their right (and left) arguments are. Here is an explicit version of your
v0=: 3 : '>: (i. <:y) , (<:y) - i. <: y' Notice that all the parentheses above just change the order of operations, they don't represent trains of verbs. You can factor this into two explicit verbs like this: v1=: 3 : '>: (<: y) v2 i. <: y' v2=: 4 : 'y , x - y' NB. same as tacit fork (] , -) It is hopefully clear that the y in v1 is not the same as the y in v2. So the answer to your question "When do I use ] rather than y?" is when the y doesn't represent the right argument to the outer verb. Note that your verb though is better represented by another level of nesting: v3=: 3 : '>: v4 <: y' v4=: 3 : 'y v2 i. y' Personally I think 13 : is a great tool for getting started with tacit or when something just isn't working, however I think weaning myself off 13 : helped with my journey to become comfortable writing tacit trains. On Sun, Jul 6, 2014 at 8:52 PM, Linda Alvord <[email protected]> wrote: > Here's something I have not understood for a long time: g is the result I > want > > H is not the result I want > g=: 13 :'>: ((],-)i.)<: y' > > h=: 13 :'>: ((y,-)i.)<: y' > > In both cases y and ] in this example seem to be 5 > > g 5 > 1 2 3 4 5 4 3 2 > > h 5 > 6 5 4 3 2 > > 5!:4 <'g' > -- [: > +- >: > │ -- [: > --+ │ -- ] > │ │ -----+- , > L----+----+ L- - > │ L- i. > L- <: > > > 5!:4 <'h' > -- 3 > -- : -+- ,:'>: ((y,-)i.)<: y' > > > How can you tell when you should be using ] instead of y ? > > Linda > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
