Disclose: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Built-in|Disclose|⊃}} is a [[monadic function]] | {{Built-in|Disclose|⊃}} or '''Reveal''' is a [[monadic function]] in [[Nested array model|nested]] APLs which reduces the level of nesting of an array. Early experiments in array nesting usually defined a primitive to extract the contents of a nested [[scalar]], but did not always specify how it should behave on an array. [[Jim Brown]]'s "A Generalization of APL",<ref>[[Jim Brown]]. [http://www.softwarepreservation.org/projects/apl/Books/AGENERALIZATIONOFAPL "A Generalization of APL"] (Ph.D. thesis). 1971.</ref> stated that it "may be undefined" on non-scalar arrays. However, all dialects do define it on non-scalars, but with differing definitions. Some dialects, for example [[Dyalog APL]], have it extract the argument's initial element in [[ravel order]], while others, for example [[APL2]] have it combine the array's elements (requiring conforming shapes or padding with [fill element]]s). Depending on which approach is taken, it is recommended to use the unambiguous names [[First]] and [[Mix]] for these two functions. | ||
For a discussion of all uses of the [[glyph]] <code>⊃</code>, see [[Right Shoe]]. | For a discussion of all uses of the [[glyph]] <code>⊃</code>, see [[Right Shoe]]. | ||
== References == | |||
<references/> | |||
{{APL built-ins}}[[Category:Primitive functions]] | {{APL built-ins}}[[Category:Primitive functions]] |
Revision as of 12:27, 1 May 2020
⊃
|
Disclose (⊃
) or Reveal is a monadic function in nested APLs which reduces the level of nesting of an array. Early experiments in array nesting usually defined a primitive to extract the contents of a nested scalar, but did not always specify how it should behave on an array. Jim Brown's "A Generalization of APL",[1] stated that it "may be undefined" on non-scalar arrays. However, all dialects do define it on non-scalars, but with differing definitions. Some dialects, for example Dyalog APL, have it extract the argument's initial element in ravel order, while others, for example APL2 have it combine the array's elements (requiring conforming shapes or padding with [fill element]]s). Depending on which approach is taken, it is recommended to use the unambiguous names First and Mix for these two functions.
For a discussion of all uses of the glyph ⊃
, see Right Shoe.
References
- ↑ Jim Brown. "A Generalization of APL" (Ph.D. thesis). 1971.