Terrence:
Most of the J constructs are designed to do what you want without
agonizing over the details.
A good example is dyadic ; , so
1 ; 1 2 ; 1 2 3
+-+---+-----+
|1|1 2|1 2 3|
+-+---+-----+
can be thought of as "box the arguments and put them in a list". This
is not what it does, however:
f=:4 : '(<x),<y'
1 f 1 2 f 1 2 3
+-+-----------+
|1|+---+-----+|
| ||1 2|1 2 3||
| |+---+-----+|
+-+-----------+
More generally, one of the ways to learn is through selective
ignorance: at the moment, you don't need to know about dyadic rank.
Here's why. When you invoke a dyad x v y, you should have x as
control information, and y as data. You do not lose anything by
supposing that v has infinite left rank (you may as well use all the
control information for each evaluation, although you may use a
different part of the data). So put your control information in a
noun n , and then use n&v"r y , where r is the right rank. This will
get you a long way.
Obviously this does not cover all cases. One of the earliest
stumbling blocks is dyadic u/ , where you are misled by multiplication
table examples into thinking it has the same left and right ranks.
Matrix operations are another, although if you are using them, you
should have some clue about what to do.
I personally cannot learn anything by reading the manuals: I need to
read and write programs. The former is more important for J than some
other languages, since it does a lot of things that you could not infer
from Fortran-style or object-oriented programming. Being a believer
in the principle that the best time to learn how to fly an airplane is
when the pilot had the fish and you are being talked down by the
tower, I find it helps if I have to solve a problem.
My first serious program in J involved presenting digital signalling
examples using the (slow) Fourier transform. This used matrix
algebra, complex arithmetic, polynomials, convolution and plotting,
all of which I knew J purported to be good at. I was able to get it
working both for demonstrations, and actually constructing digital
sound filters.
My second problem involved parsing and string manipulations. I did
not know how to program tacitly, and everything was very slow, since I
was applying explicit verbs at low rank. While I succeeded in getting
it to work, my solution was unsatisfactory. I would have been better
off using Perl. The promise of better performance prompted me to get
at least a tenuous grip on tacit programming. It took me a long
while, however, and I relied on 13 : a lot.
Overall, I suggest ignoring the details, and trying to solve a problem
that exploits J's known strengths. There are large parts you can
ignore for now, and possibly forever. For example, I never write my
own conjunctions, except in the most trivial cases, I never use @. ,
and I almost never use gerunds. I do use ^: and #~ very often, and I
picked those up through reading actual program examples, rather than
the introductory materials.
However, these are suggestions from my personal experience: you know
what works best for you.
Best wishes,
John
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm