Both are the same mechanism at different granularity — the marshaller picks the unit from the
element type — and a blank drops out of either. The scalar case is the common one; the range case
exists because a reference UNION is a single argument holding several areas: a parameter that does
not declare Flatten refuses one outright (#VALUE! — TRANSPOSE((A1:A3,C1:C3)) in Excel), and a
body that declares it answers for the union itself, in one line, the way Excel's own do:
AREAS counts the areas, SUM adds them, ROWS answers #REF! to more than one, the lookups
#N/A.
At the type level it is T[], so the body reads the list directly.
Type Parameters
T
Example
exportfunctionIRR(values: Flatten<number>, guess?: number): number { ... } exportfunctionNETWORKDAYS(start: Date, end: Date, holidays?: Flatten<Scalar>): number { ... } exportfunctionINDEX(array: Flatten<IRange>, rowNum?: number, ...): any { ... }
Declares that a parameter takes ONE argument and receives it UNPACKED into a list.
The length comes from the argument's CONTENTS, which is what separates it from every repeating form — there the length comes from the argument COUNT:
What "unpacked" means depends on the element type
Tnumber,string,Scalar)NETWORKDAYS's holidaysIRange,IReferenceRange)INDEX((A1:B2,C3:D4),…)Both are the same mechanism at different granularity — the marshaller picks the unit from the element type — and a blank drops out of either. The scalar case is the common one; the range case exists because a reference UNION is a single argument holding several areas: a parameter that does not declare
Flattenrefuses one outright (#VALUE!—TRANSPOSE((A1:A3,C1:C3))in Excel), and a body that declares it answers for the union itself, in one line, the way Excel's own do:AREAScounts the areas,SUMadds them,ROWSanswers#REF!to more than one, the lookups#N/A.At the type level it is
T[], so the body reads the list directly.