You can store several elements in a list with URBI, simply by putting them between brackets:
mylist = [1,2,35.12,"hello"]; mylist; [139464:notag] [1.000000,2.000000,35.120000,"hello"]
You can easily add elements or add a list:
mylist = [1,2] + "hello"; mylist; [146711:notag] [1.000000,2.000000,"hello"] x = 1; mylist + [45,x]; [148991:notag] [1.000000,2.000000,"hello",[45.000000,1.000000]]
Then, you can scan the content of a list with a foreach command:
list = [1,2];
foreach n in list { echo n };
[151228:notag] *** 1.000000
[151228:notag] *** 2.000000
Note that, for technical reasons, the code executed in the foreach command must be enclosed between brackets, even if there is only one command in it.
You can also directly access an element of a list with its position, like in an array:
mylist = [1,2,"hello"]; mylist[2]; [146711:notag] "hello"
If you have lists containing lists, you can use multiple indexes like mylist[3][4] to access sub-elements.
Finally, you can also "traditionnaly" get the first element with head and the rest of the list (excluding the first element) with tail:
mylist = [1,2,"hello"]; head(mylist); [146711:notag] 1.000000 tail(mylist); [146711:notag] [2.000000,"hello"]