Skip to content
Splizard edited this page May 1, 2018 · 5 revisions

i has support for lists of any type.

To make an empty list:
l = []

Elements can be put inside of the list, all the elements in a list are required to be the same type.

l += "Element"

Lists can be used just like arrays, they can be indexed, modified and looped over.

print(l[0])
l[0] = "Different"
for element in l 
    print(element)
end 

Lists can also be initialised literally.

fruit = ["Orange", "Apple", "Pear"]

In order to add a list to a type, you do this in the type definition:

type MyType {
   fruit = list.text()
}

Any type can be defined as a list, simply use the type name after list dot.

Clone this wiki locally