On 5/1/07, Geoff Canyon <[EMAIL PROTECTED]> wrote:
That said, I fool around at projecteuler.net.

You are way ahead of me, there.

I feel like an ancient alchemist working from a dusty tome, who can
only mix up what the formulas tell him, never anything new. I look at
something as simple as $,: and I don't know what it will do until I
look it up.

This is a problem?  Why?

Or are you saying that  you are trying to do everything in your
head, and are not trying out example code with example data?

Something like:

mis =: monad def '>./(0:>.+)/\.y.,0'

is a serous puzzle.

Well, yeah... you said you are not using explicit programming at
all, and that's explicit code.  That's also explicit code from a
historical version of J which should throw an error with a current
version of J  (y. should be replaced by y).

To see the tacit version, replace y. with y and monad with 13
  13 def '>./(0:>.+)/\.y,0'
[: >./ [: (0: >. +)/\. 0 ,~ ]

To break that down further, you could do:
  v1=: 0 ,~ ]
  v2=: 0: > +
  v3=: (0: >. +)/\.
  v4=: [: v3 v2

And, you could try each of these verbs with sample data...
  (0 ,~ ]) 1 2 3
1 2 3 0
  (0 >. +)/\. 1 2 3 0
6 5 3 0

etc.

All of them except v2 should take the same argument as the original.
Also, v2/ winds up being used on the sequences that the v\. monad
creates, and you should not feel any embarassment at having to
look in the dictionary to see that those are suffixes.

  2 (0>.+) 3 (0>.+) 0
5

So my question is this: how long should I expect it to take before I
"get" J, at least enough that I can puzzle through other people's
code without having to grab the dictionary every other symbol?

For projecteuler code?  Quite a while.

Personally, I bring up the dictionary quite often, even when I think I
know the word, just to make sure I haven't mis-remembered something.
And that's not even venturing into projecteuler territory.

The fastest way to bring up the dictionary, that I know of is:

Find a J window
type the relevant symbol
hit Control-F12

That said, I usually don't spend much time in the dictionary.  Once
I'm certain I've not overlooked any key issues, my next step in making
sure I understand the code with relevant sample data.

In my opinion, I never really understand the code until I understand the
associated data.

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

Reply via email to