trusted
41
edits
(dzaima/APL update) |
|||
Line 50: | Line 50: | ||
t←(~u)\a ⋄ (u/t)←b ⋄ t | t←(~u)\a ⋄ (u/t)←b ⋄ t | ||
</source> | </source> | ||
The two steps can be reversed, as long as <source lang=apl inline>a</source> is paired with <source lang=apl inline>~u</source> and <source lang=apl inline>b</source> is paired with <source lang=apl inline>u</source>. [[Structural Under]] allows the assignment to be performed in a functional style, with no temporary variable. For example, | The two steps can be reversed, as long as <source lang=apl inline>a</source> is paired with <source lang=apl inline>~u</source> and <source lang=apl inline>b</source> is paired with <source lang=apl inline>u</source>. [[Structural Under]] allows the assignment to be performed in a functional style, with no temporary variable. For example, [[dzaima/APL]] admits these implementations: | ||
<source lang=apl> | <source lang=apl> | ||
b⍨⍢(u∘⌿) (~u)⍀a | |||
a⍨⍢((~u)∘⌿) b⍨⍢(u∘⌿) a,b | a⍨⍢((~u)∘⌿) b⍨⍢(u∘⌿) a,b | ||
</source>{{Works in|[[dzaima/APL]]}} | </source>{{Works in|[[dzaima/APL]]}} |