[Jprogramming] Writing dyadic function with left/right parameters swapped
Raul Miller
rauldmiller at gmail.com
Sun Jun 4 14:03:34 UTC 2017
Like this?
(#~ 5=2#.@:|])z
3 4 5
--
Raul
On Sun, Jun 4, 2017 at 9:43 AM, Michael Rice <limitcase at gmail.com> wrote:
> How about
> 1 0 1 0 1 0 (#~ ((-: & 0 1 0)"1 @: ({~ & z)))~ z
> ?
>
> Odd, that's the KISS way, the way that always works, and the one way I
> hadn't considered.
>
> On to your "simplifications."
>
> On Sat, Jun 3, 2017 at 10:16 PM, Louis de Forcrand <olius at bluewin.ch> wrote:
>
>> How about
>> 1 0 1 0 1 0 (#~ ((-: & 0 1 0)"1 @: ({~ & z)))~ z
>> ?
>> You can then "simplify":
>>
>> First the hook (and {~&z)
>> ([ #~ -:&0 1 0"1@:(z&{)@])~
>> ([ #~ -:&0 1 0"1@:(z&{)@])~
>>
>> Then ~ can be "distributed" over the resulting fork:
>> [~ #~ -:&0 1 0"1@:(z&{)@(]~)
>> ] #~ -:&0 1 0"1@:(z&{)@[
>>
>> You can keep going;
>> From bonding to forks:
>> ] #~ (] -: 0 1 0"_)"1@:(z { ])@[
>> Composition and -: commutativity:
>> ] #~ (0 1 0 -: ])"1@:(z { ]@[)
>> Because 1=#$0 1 0:
>> ] #~ (0 1 0 -:"1 ])@:(z { [)
>> Trains:
>> ] #~ (0 1 0 -:"1 ]@:(z { [))
>> ] #~ 0 1 0 -:"1 ]@:(z { ])
>> ] #~ 0 1 0 -:"1 z { [
>>
>> Can't get it any simpler.
>>
>> Cheers,
>> Louis
>>
>> > On 4 Jun 2017, at 03:45, Michael Rice <limitcase at gmail.com> wrote:
>> >
>> > z (#~ ((-: & 0 1 0)"1 @: ({~ & z))) 1 0 1 0 1 0
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list