Other Features
Another key feature of the CLU type system are iterators, which return objects from a collection one after the other. Iterators were "black boxes" that offered an identical API no matter what data they were being used with. Thus the iterator for a collection of complex_number
s would be identical to that for an array of integer
s. Iterators are now a common feature of most modern languages(See Iterator).
CLU also includes exception handling, based on various attempts in other languages; exceptions are raised using signal
and handled with except
. Oddly, given the focus on type design, CLU does not offer enumerated types, nor any obvious way to create them.
A final distinctive feature in CLU is multiple assignment, where more than one variable can appear on the left hand side of an assignment operator. For instance, writing x,y = y,x
would exchange values of x
and y
. In the same way, functions could return several values, like x,y,z = f(t)
.
All objects in a CLU program live in the heap, and memory management is automatic.
Read more about this topic: CLU (programming Language)
Famous quotes containing the word features:
“Each reader discovers for himself that, with respect to the simpler features of nature, succeeding poets have done little else than copy his similes.”
—Henry David Thoreau (18171862)
“The features of our face are hardly more than gestures which force of habit made permanent. Nature, like the destruction of Pompeii, like the metamorphosis of a nymph into a tree, has arrested us in an accustomed movement.”
—Marcel Proust (18711922)