Fill element: Difference between revisions

Jump to navigation Jump to search
209 bytes added ,  22:31, 10 September 2022
m
Text replacement - "<source" to "<syntaxhighlight"
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
m (Text replacement - "<source" to "<syntaxhighlight")
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
A '''fill element''' is an [[element]] used for the result of a [[function]] when no element from the [[argument]] or another relevant array is used. The fill element is usually that array's [[prototype]]. [[J]] allows the fill to be specified using the fit conjunction <source lang=j inline>!.</source>, an analogue of [[Variant]].
A '''fill element''' is an [[element]] used for the result of a [[function]] when no element from the [[argument]] or another relevant array is used. The fill element is usually that array's [[prototype]]. [[J]] allows the fill to be specified using the fit conjunction <syntaxhighlight lang=j inline>!.</syntaxhighlight>, an analogue of [[Variant]].


Fills are one way to convert an [[empty array]] into a non-empty array. [[Reduction]] along an empty [[axis]] also produces such a transition, but in this case an [[identity element]] for the reducing function is used instead of a fill.
Fills are one way to convert an [[empty array]] into a non-empty array. [[Reduction]] along an empty [[axis]] also produces such a transition, but in this case an [[identity element]] for the reducing function is used instead of a fill.
Line 10: Line 10:
! Glyph                              !! Monad                                          !! Dyad
! Glyph                              !! Monad                                          !! Dyad
|-
|-
| <source lang=apl inline>⍴</source> ||                                                || [[Reshape]]
| <syntaxhighlight lang=apl inline>⍴</syntaxhighlight> ||                                                || [[Reshape]]
|-
|-
| <source lang=apl inline>↑</source> || [[Mix]] (or <source lang=apl inline>⊃</source>) || [[Take]]
| <syntaxhighlight lang=apl inline>↑</syntaxhighlight> || [[Mix]] (or <syntaxhighlight lang=apl inline>⊃</syntaxhighlight>) || [[Take]]
|-
|-
| <source lang=apl inline>/</source> and <source lang=apl inline>⌿</source> ||          || [[Replicate]]
| <syntaxhighlight lang=apl inline>/</syntaxhighlight> and <syntaxhighlight lang=apl inline>⌿</syntaxhighlight> ||          || [[Replicate]]
|-
|-
| <source lang=apl inline>\</source> and <source lang=apl inline>⍀</source> ||          || [[Expand]]
| <syntaxhighlight lang=apl inline>\</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍀</syntaxhighlight> ||          || [[Expand]]
|-
|-
| <source lang=apl inline>⍤</source> ||colspan=2| [[Rank operator]]
| <syntaxhighlight lang=apl inline>⍤</syntaxhighlight> ||colspan=2| [[Rank operator]]
|-
|-
| <source lang=apl inline>⌸</source> ||colspan=2| [[Key]]
| <syntaxhighlight lang=apl inline>⌸</syntaxhighlight> ||colspan=2| [[Key]]
|-
|-
| <source lang=apl inline>⌺</source> ||colspan=2| [[Stencil]]
| <syntaxhighlight lang=apl inline>⌺</syntaxhighlight> ||colspan=2| [[Stencil]]
|}
|}


Line 35: Line 35:
=== Documentation ===
=== Documentation ===


* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Fill%20Elements.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Introduction/Variables/Prototypes and Fill Items.htm Dyalog]


{{APL features}}[[Category:Function characteristics]]
{{APL features}}[[Category:Function characteristics]]

Navigation menu