Zilde: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Built-in|Zilde|⍬}} or '''Zero-tilde''' (which the common name is a portmanteau of), is | {{Built-in|Zilde|⍬}}, or '''Zero-tilde''' (which the common name is a portmanteau of), is the [[empty]] [[numeric]] [[vector]]. It shares its name with the [[glyph]] used to represent it, a zero overstruck with a tilde. It is the [[shape]] of any [[scalar]], although its own shape is <source lang=apl inline>,0</source>. This is because, as a vector, it has exactly one [[axis]], and this axis has length 0. Zilde is equivalent to <source lang=apl inline>⍳0</source> and <source lang=apl inline>⍴0</source> and <source lang=apl inline>0⍴0</source>. Being [[numeric]], Zilde's [[prototype]] is 0. | ||
The [[glyph]] Zilde is notable in that it represents an array rather than a [[primitive function]] or [[primitive operator]]. In most APLs it is the only array literal which is produced using its own token rather than being part of a family of array literals like [[numeric literal]]s, [[string]]s, or [[system constant]]s (an exception is [[SHARP APL]]'s [[nil]] (<source lang=apl inline>∘</source>), which is the same as <source lang=apl inline>⊂⍬</source>). | |||
It should be noted that the empty numeric vector (<source lang=apl inline>⍬</source>) is distinct from the empty character vector (<source lang=apl inline>''</source>) even though they have the same shape and the same elements: | It should be noted that the empty numeric vector (<source lang=apl inline>⍬</source>) is distinct from the empty character vector (<source lang=apl inline>''</source>) even though they have the same shape and the same elements: | ||
Line 18: | Line 18: | ||
* <source lang=apl inline>,¨⍬</source> gives an empty vector of 1-element numeric vectors, identical to <source lang=apl inline>0⍴⊂,0</source>. | * <source lang=apl inline>,¨⍬</source> gives an empty vector of 1-element numeric vectors, identical to <source lang=apl inline>0⍴⊂,0</source>. | ||
* <source lang=apl inline>⍪¨⍬</source> gives an empty vector of 1-by-1 numeric matrices, identical to <source lang=apl inline>0⍴⊂,0</source>. | * <source lang=apl inline>⍪¨⍬</source> gives an empty vector of 1-by-1 numeric matrices, identical to <source lang=apl inline>0⍴⊂,0</source>. | ||
{{APL glyphs}}[[Category:Primitive arrays]] | {{APL built-ins}}{{APL glyphs}}[[Category:Primitive arrays]] |
Revision as of 14:55, 4 May 2020
⍬
|
Zilde (⍬
), or Zero-tilde (which the common name is a portmanteau of), is the empty numeric vector. It shares its name with the glyph used to represent it, a zero overstruck with a tilde. It is the shape of any scalar, although its own shape is ,0
. This is because, as a vector, it has exactly one axis, and this axis has length 0. Zilde is equivalent to ⍳0
and ⍴0
and 0⍴0
. Being numeric, Zilde's prototype is 0.
The glyph Zilde is notable in that it represents an array rather than a primitive function or primitive operator. In most APLs it is the only array literal which is produced using its own token rather than being part of a family of array literals like numeric literals, strings, or system constants (an exception is SHARP APL's nil (∘
), which is the same as ⊂⍬
).
It should be noted that the empty numeric vector (⍬
) is distinct from the empty character vector (''
) even though they have the same shape and the same elements:
∧/⍬='' 1 ⍬≡'' 0
This is because ⍬=''
itself returns an empty numeric vector, and reducing an empty vector with the Logical And function (∧
) yields the identity element of Logical And, which is 1. However, match takes empty array prototypes into account as well as shapes and elements, so it indicates that the arrays are different.
Zilde can be used to concisely produce other empty arrays, for example:
⍬⊤⍬
gives a 0-row 0-column numeric matrix, identical to0 0⍴0
.⍪⍬
gives a 0-row 0-column numeric matrix, identical to0 1⍴0
.,¨⍬
gives an empty vector of 1-element numeric vectors, identical to0⍴⊂,0
.⍪¨⍬
gives an empty vector of 1-by-1 numeric matrices, identical to0⍴⊂,0
.
APL glyphs [edit] | |
---|---|
Information | Glyph ∙ Typing glyphs (on Linux) ∙ Unicode ∙ Fonts ∙ Mnemonics ∙ Overstrikes ∙ Migration level |
Individual glyphs | Jot (∘ ) ∙ Right Shoe (⊃ ) ∙ Up Arrow (↑ ) ∙ Zilde (⍬ ) ∙ High minus (¯ ) ∙ Dot (. ) ∙ Del (∇ )
|