That's really rather subtle, David.

At first I thought: u=: 3 : '(+/ y) % (# y)'
--was a mistake. But ((+/) % #) actually (only) gets called
monadically in (dyadic) foo ...
   foo=:  ((+/) % #) @ ((,&1)"1)

> v=. ((,&1)"1)   NB. difficult to explain here. ************

Referring to Help > Voc > Bond , I see:
"The phrase x f@[&0 y is equivalent to f^:x y , apply the monad f x
times to y ."

This suggests a variant of your dyad: foo_explicated, which tries to
expand dyadic v .

foo_explicated=: 3 : 0
        NB. ((+/) % #) @ ((,&1)"1)
u=: 3 : '(+/ y) % (# y)'        NB. [rank: _ _ _]   (+/) % #
v=: (3 : 'y , 1')"1             NB. [rank: 1 1 1]   (,&1)"1
m=: u"v v y                     NB. [rank: 1 1 1]   ((+/) % #) @ ((,&1)"1)
:
u=: 3 : '(+/ y) % (# y)'        NB. [rank: _ _ _]   (+/) % #
v=: (3 : 'y , 1')"1             NB. [rank: 1 1 1]   (,&1)"1
m=: v^:x y                      NB. dyadic(&) --> (^:)
n=: u"v m                       NB. Brian's suggestion for (@)
)

The derivation of m and n are a little bit debatable, but it does at
least alert the novice to the issues to read up about.

Note the use of =: to make intermediate words u v ... m n ...
available for inspection and creative play by the user.

>   Ian hoped for a correct solution 95% of the time.

Recalling Crosby's "Quality Is Free" and the Japanese
car-manufacturers, given time to chip away at it with pathological
examples, I can forever strive towards 100% even if this is a
theoretically unattainable goal.

So... thanks everybody, I think I have enough ideas from this thread
now to try and implement "explicate" along the lines of Ambrus's
tte.ijs. It could turn out to be a valuable learning tool, though only
a novice can really say. (It will certainly be valuable for me.)

Ian


On Wed, Jul 25, 2012 at 4:19 PM, David Ward Lambert
<[email protected]> wrote:
> (Per my thread recollection)
>   Raul mentioned that both valences should show.
>   Ian hoped for a correct solution 95% of the time.
>
> This particular verb is interesting as a dyad because bond causes
> repetition.  Would we expand as some awful for. loop?
>
> foo_explicated=: 3 : 0
>         NB. ((+/) % #) @ ((,&1)"1)
> u=: 3 : '(+/ y) % (# y)'        NB. [rank: _ _ _]   (+/) % #
> v=: (3 : 'y , 1')"1             NB. [rank: 1 1 1]   (,&1)"1
> w=: u@v                         NB. [rank: 1 1 1]   ((+/) % #) @
> ((,&1)"1)
> w y
>
> :
>
> u=. 3 : '(+/ y) % (# y)'        NB. [rank: _ _ _]   (+/) % #
> v=. ((,&1)"1)   NB. difficult to explain here. ************
> w=. u@v
> x w y
> )
>
>
>
>> Date: Wed, 25 Jul 2012 15:51:41 +0100
>> From: Ian Clark <[email protected]>
>> To: [email protected]
>> Subject: Re: [Jprogramming] fully parenthesized representation of a
>>         tacit   verb
>> Message-ID:
>>         <CAB2g=gdh7tky7s3btkmfv9irh9zmkyuh84rsauouifknjbh...@mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>
>> The trouble is, deducing the rank of u@v knowing the ranks of the
>> verbs u and v is not easy to explicate (if at all) by passing a single
>> intermediate noun (z) from v to u. My solution was a fudge. I guess
>> foo is best explained -- and understood -- by assigning intermediate
>> verbs instead of nouns. (Or: as well as nouns.) I guess Linda is
>> making the same point.
>>
>> So here's a clearer explication, and hopefully a more accurate one:
>>
>> foo_explicated=: 3 : 0
>>         NB. ((+/) % #) @ ((,&1)"1)
>> u=: 3 : '(+/ y) % (# y)'        NB. [rank: _ _ _]   (+/) % #
>> v=: (3 : 'y , 1')"1             NB. [rank: 1 1 1]   (,&1)"1
>> w=: u@v                         NB. [rank: 1 1 1]   ((+/) % #) @
>> ((,&1)"1)
>> w y
>> )
>>
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to