Rank does have several meanings. Have you read this writeup? http://en.wikipedia.org/wiki/Rank_(J_programming_language)
(from back in the day when wikipedia did not have a teams of people actively removing new content.) That said, your foox works, but in other cases that kind of rephrasing would cause problems. So I consider it misleading. Consider, for example: (+/ ; i.)@(,&1"1) i. 2 2 vs z=: ((i. 2 2) (,"1) 1) (+/"1 z) ;"1 (i."1 z) (So perhaps I should just ignore everything other than hooks and forks, for now...?) -- Raul On Tue, Jul 24, 2012 at 3:11 AM, Ian Clark <[email protected]> wrote: >> Consider, for example: >> (+/%#)@(,&1"1) i. 3 4 >> >> If we eliminate the noun, and try to explain the verb, what would you >> want to see here? > > The short answer is: whatever would be clearest for the J novice. > > Let's call your example foo and show it under 5!:6 (and slightly more > spaced) ... > > foo=: ((+/) % #) @ ((,&1)"1) > foo i.3 4 > 1.4 4.6 7.8 > > Since I don't understand Rank (") as fully as I'd like, I really can't > say what would be clearest in this case. But I don't now think an > explicit one-liner would be at all clear, even if I could think how to > generate it. I'm already puzzling over how to "explicate" verb > phrases: u@v u@:v u&v . > > I find Ambrus's approach with tte.ijs the most appealing: @ @: & > themselves disappearing in a multi-stage expansion. The existing "tte" > refuses to break down this example. But I'd hope for something like > this... > > foox=: 3 : 0 > NB. ((+/) % #) @ ((,&1)"1) > z=. (y (,"1) 1) NB. ((,&1)"1) > (+/"1 z) %"1 (#"1 z) NB. ((+/) % #) @ ... > ) > > foox i.3 4 > 1.4 4.6 7.8 > > > On Mon, Jul 23, 2012 at 4:23 PM, Raul Miller <[email protected]> wrote: >> On Fri, Jul 20, 2012 at 11:45 PM, Ian Clark <[email protected]> wrote: >>> To take an example for the benefit of pragmatists trying to follow >>> this thread, I'm not asking for a whole BNF grammar but a simple >>> pragmatic set of transformation rules to convert, say: >>> 4 : 'x (a b c d) y' >>> into, say: >>> 4 : 'x a ((b y) c (d y))' >>> which I loosely called "multiplying out". >> >> If I were attempting this, I think I would start with atomic >> representation (5!:1 instead of 5!:6). >> >> In the context of 5!:1 I would look for lists whose first elements >> were <,'3' (second element of the list contains 3 atomic >> representations which are combined in a fork) and whose first elements >> were <,'2' (second element of the list contains 2 atomic >> representations which are combined in a hook). >> >> I think I would also be providing both monadic and dyadic definitions >> (keeping in mind that hooks and forks sometimes constrain the context >> for contained verbs. For example, the first verb in a hook is always >> used dyadically and the second verb is always used monadically. >> >> But note that there are cases which present themselves here which >> deserve some thought. >> >> Consider, for example: >> >> (+/%#)@(,&1"1) i. 3 4 >> >> If we eliminate the noun, and try to explain the verb, what would you >> want to see here? >> >> Thanks, >> >> -- >> Raul >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
