[Jprogramming] problem with under
Henry Rich
HenryHRich at nc.rr.com
Fri Oct 28 04:34:41 HKT 2011
I just noticed that
/:~ : /:
can replaced by
/:~~
bivalently.
Henry Rich
On 10/27/2011 4:03 PM, Kip Murray wrote:
> I like especially your second form I =: ([:< [: /: ":)"0
>
> For the third form I =:< @ /: @ ": " 0 note that [: f g and f @: g are
> always equivalent, but f @: g and f @ g are not when g has rank 0 --
> conjunction @: always uses sequential processing, but conjunction @ uses
> parallel processing when g has rank 0, as shown below.
>
>
> (+/ @: *:) 3 4
> 25
>
> (+/ @ *:) 3 4
> 9 16
>
>
> In the first case above the right to left flow chart is
>
> 25<-- +/<-- 9 16<-- *:<-- 3 4 (sequential processing)
>
> while in the case involving @ the flow chart is
>
> <-- 9<-- *:<-- 3
> 9 16<-- +/ (parallel processing because *: is rank 0)
> <-- 16<-- *:<-- 4
>
>
> As I nearly always want sequential processing I use
>
> [: f [: g h (read "the f the g h")
>
> or
>
> f @: g @: h (read math's "f o g o h")
>
>
> Check:
>
> ([: +/ *:) 3 4
> 25
>
>
> On 10/27/2011 5:21 AM, Raul Miller wrote:
>> Also, for the domain in question, we are not using> for anything but its rank.
>>
>> Thus we could simplify:
>>
>> I =: ([:< [: /: [: ": ])"0
>>
>> Also, since we are always using this as a monad, we could further simplify:
>>
>>
>> I =: ([:< [: /: ":)"0
>>
>> Though, personally, I find myself comfortable using @
>>
>> I =:<@/:@":"0
>>
>> Or, going back to the original message, and applying @ to achieve what
>> the dictionary was talking about:
>>
>> <@([: /: ":)@>a,b
>>
>> Or, using "0 to replace @>
>>
>> <@([: /: ":)"0 a,b
>>
>> But if you are using trains in boxes, maybe it's better to state that
>> explicitly, and that could also get rid of any of the @ conjunctions:
>>
>> ([: /: ":) L:0<"0 a,b
>>
>> That said, when you replace a shorter expression with a longer one, I
>> think you should expect the longer one to lose some of the grace of
>> the original.
>>
>> I hope this helps.
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list