4,500
edits
No edit summary |
|||
Line 25: | Line 25: | ||
=== Leading axis model === | === Leading axis model === | ||
The behavior of Membership was changed to follow [[leading axis model]] in some implementations such as [[J]]. In this case, if the right argument is a higher-[[rank]] array, the [[cell|cells]] of the left argument with appropriate rank are compared against the [[major cell|major cells]] of the right argument. | The behavior of Membership was changed to follow [[leading axis model]] in some implementations such as [[J]] (spelled <source lang=j inline>e.</source>). In this case, if the right argument is a higher-[[rank]] array, the [[cell|cells]] of the left argument with appropriate rank are compared against the [[major cell|major cells]] of the right argument. | ||
<source lang=j> | <source lang=j> | ||
Line 43: | Line 43: | ||
1 1 1 | 1 1 1 | ||
</source> | </source> | ||
In other dialects, a leading axis membership function can be defined as: | |||
<source lang=apl> | |||
E←{(≢⍵)≥⍵⍳⍺} | |||
⎕←mat←3 4⍴'ableacreidle' | |||
able | |||
acre | |||
idle | |||
'able' E mat | |||
1 | |||
</source>{{Works in|[[Dyalog APL]], [[NARS2000]], [[dzaima/APL]], [[Extended Dyalog APL]], [[GNU APL]]}} | |||
== External links == | == External links == |