Marry, pray, Whichcraft in J!

Here is some practice material for beginning and advanced J programmers alike.

Just in case it happens to be the start of the week and you're looking for some

distraction from Real Work ;-)

Martin Neitzel

While reading Roger Hui's "Rank and Uniformity" from the APL95 proceedings,

I came across the following funky phrase that I did understand immediately:

[ ^: some_comparison

If this isn't already an old hat to you, you're invited to sharpen your

J skills a little bit on this small but useful phrase, too.

Predict the results of

17 ([^:<) 4 and

17 ([^:<) 21

Substitute ] for [ and/or > for < .

This will give you a good impression of what it does. If you cheated on the

predictions, figure now out how it works. Look up the definitions of

Left "[", Less Than "<", and Power "^:". What kind of train is [^:< , and

where do the arguments go?

In general you'll use more complicated boolean relationships r in [^:r

(Roger needed a <&# in his article.) The phrase makes it also easy to

to look for extremes in larger data sets. Just use [^:r/ on (non-empty)

item lists.

You are a seasoned Juggler and are bored so far? Then quick!, either

without or with consulting the Dictionary, but without experiments:

- What is 2 [^:(2) 17 ?

- What is 2 [^:(_1) 17 ?

- What is 2 [^:(_1 _2 _3) 17 ?

- What is +/ 2 [^:(-i.100) 17 ?