On Thu, Dec 18, 2008 at 4:59 PM, John Randall
<[email protected]> wrote:
> When using complex numbers, I often want to order them lexicographically
> on (real part, imaginary part).  J's TAO enables me to do and define verbs
> like
>
> leq=:0 1-:/:@:,
> max=:{:@:/:~
> imax=:{:@:/:
>
> for less than or equal to, maximum, and index of maximum respectively.
>
> I feel that I am missing something, however, and I ought to do it with an
> adverb.  The spirit of these operations is to use grade, and then carry
> out the original operation on the graded array.  Or is it just bond?

All of your verbs use grade.

However, each of them uses grade in a different fashion.

You can see this in /:@:, (where you are emulating a dyad)
/:~ (where you are emulating a reduce) and just plain /:

In other words, you have at least as many patterns here,
as you have verbs.  I think you would need more verbs
before extracting particular patterns would be worthwhile.

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

Reply via email to