Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 705 Bytes

File metadata and controls

50 lines (35 loc) · 705 Bytes

Tuples

Examples

Initialization

const a = new Tuple([1, 2]);

Initialization Sugar

const a = #[1, 2];

Extension

const b = a.concat(#[3, 4]);

Extension Sugar

const b = #[...a, 3, 4];

Type

typeof #[]; // 'tuple'

Syntax

TupleLiteral:

  • # [ (TupleElement (, TupleElement)*)? ]

TupleElement:

  • AssignmentExpression
  • ... AssignmentExpression

Comparison Semantics

== and === test value equality.

<, >= etc. test value order/equality in enumeration order.

Notes

Enumeration always proceeds in numeric index order.

.length cannot be greater than 2^32 - 1