Fill element: Difference between revisions

Jump to navigation Jump to search
99 bytes added ,  22:09, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
m (Text replacement - "</source>" to "</syntaxhighlight>")
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 <source 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]]
| <source lang=apl inline>⍴</syntaxhighlight> ||                                                || [[Reshape]]
|-
|-
| <source lang=apl inline>↑</source> || [[Mix]] (or <source lang=apl inline>⊃</source>) || [[Take]]
| <source lang=apl inline>↑</syntaxhighlight> || [[Mix]] (or <source lang=apl inline>⊃</syntaxhighlight>) || [[Take]]
|-
|-
| <source lang=apl inline>/</source> and <source lang=apl inline>⌿</source> ||          || [[Replicate]]
| <source lang=apl inline>/</syntaxhighlight> and <source lang=apl inline>⌿</syntaxhighlight> ||          || [[Replicate]]
|-
|-
| <source lang=apl inline>\</source> and <source lang=apl inline>⍀</source> ||          || [[Expand]]
| <source lang=apl inline>\</syntaxhighlight> and <source lang=apl inline>⍀</syntaxhighlight> ||          || [[Expand]]
|-
|-
| <source lang=apl inline>⍤</source> ||colspan=2| [[Rank operator]]
| <source lang=apl inline>⍤</syntaxhighlight> ||colspan=2| [[Rank operator]]
|-
|-
| <source lang=apl inline>⌸</source> ||colspan=2| [[Key]]
| <source lang=apl inline>⌸</syntaxhighlight> ||colspan=2| [[Key]]
|-
|-
| <source lang=apl inline>⌺</source> ||colspan=2| [[Stencil]]
| <source lang=apl inline>⌺</syntaxhighlight> ||colspan=2| [[Stencil]]
|}
|}


Navigation menu