[Jprogramming] Writing dyadic function with left/right parameters swapped
Louis de Forcrand
olius at bluewin.ch
Sun Jun 4 02:16:19 UTC 2017
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
More information about the Programming
mailing list