Cicada ---> Online Help Docs ---> Cicada scripting ---> Variables

Lists

Lists are very similar to one-dimensional arrays. Define a list using double brackets:


    intList :: [[ ]] int
   

There is no option to set an initial list size -- initially top(intList) is zero. However, if we try to copy data (intList = { 2, 3, 8 }), then the list will automatically resize as needed. At this point we can access the list elements using the normal array operators: intList[2], intList[<1, 2>], intList[], etc.

The most important difference between lists and arrays is that an array of arrays is a multidimensional array, whereas in an array of lists each list may have a different size. Therefore the following is legal:


    twoIntLists :: [2] intList
    twoIntLists[1] = { 3, 4 }
    twoIntLists[2] = { 0, 1, 2 }
   

In Cicada a string is defined as a list of characters. Therefore s :: string is equivalent to s :: [[]] char.


Prev: Array variables    Next: Resizing arrays/lists (and composite variables)


Last update: November 12, 2025