next up previous
Next: Record Operations Up: Expressions Previous: String Operations

List Operations

Besides comparing lists with = and !=, you can add elements to lists and concatenate them. Adding elements is done with the @ operator, and concatenating elements is done with the # operator.

For example, to insert the value 1 into the beginning of the list {2,3} you do

1 @ { 2, 3 };
which yields the list {1,2,3}. To concatenate two lists, you write
{ 0, 1 } # { 2, 3 };
which yields {0,1,2,3}.

Note that you might find ccli printing out strange things like 0@(1@(2@{ })). No worries, this is just how ccli stores the expression {0,1,2}. The two expressions evaluate to the same thing.



Eric Klavins 2003-12-03