Scalar extension: Difference between revisions

Jump to navigation Jump to search
53 bytes added ,  14:48, 20 November 2019
m
12 revisions imported: Migrate from miraheze
Miraheze>Marshall
mNo edit summary
m (12 revisions imported: Migrate from miraheze)
(3 intermediate revisions by one other user not shown)
Line 12: Line 12:
The word "extension" applies to scalar extension in two ways: first, a function is extended by making a case which would have been a [[RANK ERROR]] into a valid application. Second, the application works by conceptually extending the scalar to function as though it were an array of higher rank.
The word "extension" applies to scalar extension in two ways: first, a function is extended by making a case which would have been a [[RANK ERROR]] into a valid application. Second, the application works by conceptually extending the scalar to function as though it were an array of higher rank.


Two arrays are said to [[Conformability|conform]] if they have the same shape or at least one can be extended (it is a scalar, or, in langauges with singleton extension, has exactly one element). A pair of conforming arrays defines a single shape which describes how their elements are paired: if neither is a scalar, it is their shared shape; if one is a scalar, it is the other's shape; if both are scalars, it is <source lang=apl inline>⍬</source>.
Two arrays are said to [[Conformability|conform]] if they have the same shape or at least one can be extended (it is a scalar, or, in langauges with singleton extension, has exactly one element). A pair of conforming arrays defines a single shape which describes how their elements are paired: if neither is a scalar, it is their shared shape; if one is a scalar, it is the other's shape; if both are scalars, it is the [[empty]] vector, <source lang=apl inline>⍬</source> ([[Zilde]]).


=== Rank extension ===
=== Rank extension ===
Line 64: Line 64:
larsca
larsca
</source>
</source>
{{APL features}}

Navigation menu