A new type system for various uses
() // Unit type
i32 // int32
u32 // unsigned 32 bit integer
f64 // 64 bit float
bool // bool
bit // one bit
char // uncode char
byte // 8 bit char10 bool
8 bit
50 char
3 3 i32 // jagged array
10 10 10 byte
3i16 // NOT ALLOWEDchar* // list of chars (string)
byte* // bytes list of any length(i8, char, bool)
(i32, (char, char),((i32,f64),(bool)))(Name:50 char, age:i8, Salary:f32)(char | bool) // char or bool
(i32 | f32) // float or int
char? // char or nothing
i32? // int or nothing
Named types is nothing but aliased types
(Name: String, Website: URL) // String is char*, URL is String
List<i32> // list of ints
Dict<String,Tel> // Dict of String and Tel
[ Right | left | Top = 5 | Down ] // Right=0, Left=1, and Down=6 as expected
// Flags enum detected by usage or items (ALL or NONE constants)
[
None = NONE
Sunday|
Monday|
Tuesday|
Wednesday|
Thursday|
Friday|
Saturday|
Everyday = ALL
]
// Heterogeneous enums
[
Foo | // 0 of type i8
Bar | // 1 of type i8
Value = "Unknown"
]
// Tagged enums
[
EveryDay |
On<Date> |
Every<i8>
]