Arrays have an array type and are multidimensional like in C.
Litteral values start with an array cast and are followed by a tuple.
Use List.to_array
to convert a List
to an array type.
ikc3> a = (U8[]) {0, 1, 2}
(U8[]) {0, 1, 2}
ikc3> type(a)
U8[]
ikc3> a[0]
0
ikc3> a[1]
1
ikc3> a[2]
2
ikc3> List.to_array
cfn Array "kc3_list_to_array" (List, Sym, Result)
ikc3> List.to_array([0, 1, 2], U8[])
(U8[]) {0, 1, 2}
Top : KC3 documentation
Previous : 1.01 Introduction
Next : 1.03 Block