On Fri, Aug 13, 2010 at 4:33 PM, Dan Bron <[email protected]> wrote: > When introducing J, we often point to +/ # % as a sterling example of J's > stark clarity. > > A.&i.~ ! NB. For input N, produces all > permutations of order N (in lex. order) > > This monad is a good candidate for several reasons, particularly those which > render it lean and spare with nothing superfluous
I don't like this one, because it only really shows how the A. builtin is powerful and so it's obviously easy to use it for something like this. I don't really have a good candidate either though. There's the (i.>./) monad which finds the index of the maximal element. There's the (<./ .+~^:_) monad to compute shortest paths in an edge-weighted graph given by a matrix of distances (see "http://www.jsoftware.com/jwiki/Essays/Floyd"), but it's difficult to demonstrate with a test case. Ambrus ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
