Unique: Difference between revisions

Jump to navigation Jump to search
3 bytes removed ,  22:34, 4 October 2023
m
→‎APL model: Explicit version of the Union replacement
(→‎APL model: Synthesize previous versions, with some extra explanation)
m (→‎APL model: Explicit version of the Union replacement)
Line 94: Line 94:
If modelling the primitive via Union is not desirable due to how similar these two primitives are, it is possible to replace this particular usage of union (not generally, as it relies on the right argument being scalar) as follows:
If modelling the primitive via Union is not desirable due to how similar these two primitives are, it is possible to replace this particular usage of union (not generally, as it relies on the right argument being scalar) as follows:
<syntaxhighlight lang=apl>
<syntaxhighlight lang=apl>
m ← {0=≢⍵:⍵ ⋄ ↑⊃(⊣,⊢⊢⍤/⍨(∧/≢¨))⍨/⌽⊂¨⊂⍤¯1⊢1/⍵}
m ← {0=≢⍵:⍵ ⋄ ↑⊃{⍺,(∧/⍺≢¨⍵)/⍵}⍨/⌽⊂¨⊂⍤¯1⊢1/⍵}
</syntaxhighlight>
</syntaxhighlight>
{{Works in|[[Dyalog APL]]}}
{{Works in|[[Dyalog APL]]}}

Navigation menu