Unlike more traditional object-oriented languages, all compound structures (e.g. lists, sets, and records) have value semantics. This means they are passed and returned by-value in their entirety (as in Pascal, or most functional languages) rather than just having their references being passed by value (as in Java, or C#).
But, what does this mean? Well, for example, lists should not be thought of as objects; rather, they should be thought of as values. The following example illustrates why:
void ::main(System.Console console): xs = [1,2,3] ys = xs xs = 2 console.out.println(str(xs)) console.out.println(str(ys))
The above code will print
xs, followed by
ys. Thus, the assignment to index
xs does not affect the value of
ys. This differs from a language like Java, where one could affect the other.