1<# is a verb train called a fork. It is a special case of a fork that permits the leftmost tine of the fork to be either a verb or a noun.
On Sun, Jun 1, 2014 at 2:27 AM, Jon Hough <[email protected]> wrote: > 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 > -- (B=) <-----my sig Brian Schott ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
