Looking at J's Wikipedia page:

http://en.wikipedia.org/wiki/J_(programming_language)

I am trying to understand the quicksort example, so I am reading right to left 
and trying to understand each part as I go.

quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)
The first part , (1<#), is giving me trouble. It seems to be testing if the 
length is greater than one, and then if so the rest of the verb is run.
But from my understanding of tacit verbs, the verb (1<#) should look like this:

(1&<@:#)
Example:

(1&<@:#)  5 6 3 2

1
and
(1&<@:#)  5 

0
But then also:
(1<#) 5 3 1

1
So it seems these two verbs are equivalent. So essentially, my issue is why the 
& is not needed after the 1, which is the left argument of dyadic <?
Regards.
                                          
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to