Sorry, in the above post, I was referring to forks. Although most seem to be fond of forks, I have found hooks to be more useful and subtle (for my needs anyway). Tracy gave a great example.
Basically the monadic case of the hook can be thought of as any variable combined with itself in some way. IOW one dyadic and one monadic verb. (+!) 4 NB. i.e. 4 + !4 28 If the hook is dyadic then we combine the result of the right verb on the right argument with the left argument, rather than with itself: 3 (+!) 4 NB. i.e. 3 + !4 27 On 16 July 2014 22:12, Alex Giannakopoulos <aeg...@blueyonder.co.uk> wrote: > I suppose the most useful, from a beginner's point of view, is the cap > fork, e.g. > [: *: sin > which allows composition, and is equivalent to > *: @ sin > Some people prefer this former notation as clearer than the latter. > > So, > sin =: 1&o. > cos =: 2&o. > (([: *: sin) + [: *: cos) 9876543210 > 1 > > Basically, a handy notation for anywhere that a dyadic operator acts on > two others (if these others are monadic then the fork is monadic, if dyadic > then fork is dyadic) > > Also check this > 4 ([+[*]) 5 NB. two forks ([ + ([*])) > 24 > > > > > > On 16 July 2014 21:26, 'Dan Baronet' via Programming < > programm...@jsoftware.com> wrote: > >> I am looking for good examples of use of trains. >> Apart from the classic +/ % #, I can't think of many more. >> Anyone with some examples? They can be of any length. >> /Dan >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm