4,577
edits
m (8 revisions imported: Migrate from miraheze) |
(uses) |
||
Line 12: | Line 12: | ||
This is because <source lang=apl inline>⍬=''</source> itself returns an empty numeric vector, and reducing an empty vector with the [[Logical And]] function (<source lang=apl inline>∧</source>) yields the [[identity element]] of Logical And, which is 1. However, [[match]] takes [[empty]] array [[prototype]]s into account as well as shapes and elements, so it indicates that the arrays are different. | This is because <source lang=apl inline>⍬=''</source> itself returns an empty numeric vector, and reducing an empty vector with the [[Logical And]] function (<source lang=apl inline>∧</source>) yields the [[identity element]] of Logical And, which is 1. However, [[match]] takes [[empty]] array [[prototype]]s 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: | |||
* <source lang=apl inline>⍬⊤⍬</source> gives a 0-row 0-column numeric matrix, identical to <source lang=apl inline>0 0⍴0</source>. | |||
* <source lang=apl inline>⍪⍬</source> gives a 0-row 0-column numeric matrix, identical to <source lang=apl inline>0 1⍴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>. | |||
{{APL built-ins}} | {{APL built-ins}} |