The list Type

The list datatype allows you to keep a list of other variables. lists can contain any datatype, including other lists. lists can even contain multiple datatypes simultaneously.

lists are formed using the syntax { item1, item2, ... }.

Some simple examples of constructing lists are shown below:

myList = { 1, 2, 3.0 }.                 # a list of numbers (both int and float)
myList = { "a", "b", "c" }.             # a list of strings
myList = { "a", 30, new Mobile }.       # a list of mixed types
myList = { 1, "a", { "dog", "cow" } }.  # a list with a nested list

An important feature of lists in steve is that they are always passed by reference and are not copied. This means that if you pass a list to a function, then any modifications done to the list inside the function will modify the original list.