Raul mentioned polynomial product; it's one of my favorites. I like the way
it's commonly needed (for a range of problems) and how its array approach
can be contrasted with the manual multiplication technique that's routinely
taught. Conceptualizing the summing along diagonals strikes me as readily
interesting to those who are new to thinking in array functions.

My current favorite among terse J programs is Cartesian distance:

  [: +/&.:*: -

This is another one that has easy-to-access school-book formulation that's a
lot more complicated than the J phrasing. The demonstration of under is
lovely. Best of all, to my mind, is the way this shows the rank-neutrality
of J solutions. (This aspect of the language was what impressed me most when
I was first exposed to APL.) A synonym for this program in most languages
would be, well, tedious.

I intend to give a lightning-talk on J at the upcoming Columbus Code Camp,
and I think I'll use it to show Cartesian distance. I think I'll write a
synonym (read: close approximation) in Java to contrast the length of code
required to express the same meaning.

--
Tracy Harms




On Fri, Aug 13, 2010 at 10:33 AM, Dan Bron <[email protected]> wrote:

> ...
> 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