Each: Difference between revisions

Jump to navigation Jump to search
117 bytes added ,  04:55, 27 April 2022
(Notability is a requirement to be on the wiki, calling things "notable" is useless)
Line 3: Line 3:
Each is defined only in [[Nested array model|nested]] APLs. Some [[Flat array model|flat]] APLs obtain analogous functionality by using an [[Under]] operator with [[close composition]] along with the [[Function rank|rank]]-0 function [[Disclose]] (or Unbox). In [[SHARP APL]] this is written <source lang=apl inline>f¨></source>. In [[J]] it is <source lang=j inline>f&.></source>.
Each is defined only in [[Nested array model|nested]] APLs. Some [[Flat array model|flat]] APLs obtain analogous functionality by using an [[Under]] operator with [[close composition]] along with the [[Function rank|rank]]-0 function [[Disclose]] (or Unbox). In [[SHARP APL]] this is written <source lang=apl inline>f¨></source>. In [[J]] it is <source lang=j inline>f&.></source>.


Each differs from the [[Rank operator]] with rank 0 in that the operand arguments and results are not [[enclose]]d. As the [[elements]] of a nested array they need not be [[scalar]].
Each differs from the [[Rank operator]] with rank 0 in that the operand arguments and results are not [[enclose]]d. As the [[elements]] of a nested array they need not be [[scalar]]. <source lang=apl inline>f¨</source> can therefore be defined as <source lang=apl inline>⊂⍤f⍥⊃⍤0</source>.


The Each operator has no effect on [[scalar function]]s, since these functions already map over each array element. For example, both expressions below have the same meaning, since <source lang=apl inline>+</source> is a scalar function.
The Each operator has no effect on [[scalar function]]s, since these functions already map over each array element. For example, both expressions below have the same meaning, since <source lang=apl inline>+</source> is a scalar function.

Navigation menu