When introducing J, we often point to  +/ # %  as a sterling example of J's
stark clarity.  In fact, we've done it so much, it's become something of a
cliche; though true, it begins to ring hollow.

 

So let's introduce some variety.  What other phrases could we substitute as
exemplars?                            

 

Perusing http://www.jsoftware.com/jwiki/Essays/Polyminoes this morning, I am
reminded of the phrase for all permutations:

 

               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 (a characteristic it
shares with +/%#, and which greatly contributes to the latter's fame).

 

               - succinctly describes a well-known concept (permutations,
AKA anagrams).  

               - leverages J's unique train syntax.

                              - whereas +/%# is a good example of a fork,
A.&i.~! is a good example of a hook.

               - doesn't mention its arguments (even by reference with []),
and so a great specimen of tacit expression.

               - &i. is a sophisticated use of duality (one of J's more
unique composition operations).

               - mnemonic (A. recalls Anagrams, ! recalls permutations
[factorials and permutations are closely related])

               - aesthetically balanced (the inflections on A and i reflect
each other, as the ! reflects the i) 

 

What other Jems are suitable to introduce the language?  Why do you think
so?


-Dan

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to