1.2. Containers
Description of Letlang's builtin container types
A tuple is a collection of values. There is no tuple
class, instead, each
collection of types is the specific tuple class:
(@ok, "hello") is (atom, string); # true
(0, 0) is (number, number); # true
(0.1, 0.2) is (int, int); # false
A list is a collection of values of the same type. There is no list
class,
instead there is the list<T>
generic class:
[1, 2, 3] is list<int>; # true
[1, 2, 3.5] is list<number>; # true
[1, 2, 3.5] is list<int>; # false
A structure is a collection of named values. There is no struct
class, instead
each structured type is the specific structure class:
{x: 0, y: 0} is {x: number, y: number}; # true