Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
CLU (programming language)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Other features == Another key feature of the CLU type system are ''[[iterator]]s'', which return objects from a collection serially, one after another.<ref name=Liskov1977 /> Iterators offer an identical [[application programming interface]] (API) no matter what data they are being used with. Thus the iterator for a collection of <code>complex_number</code>s can be used interchangeably with that for an array of <code>integer</code>s. A distinctive feature of CLU iterators is that they are implemented as coroutines, with each value being provided to the caller via a ''yield'' statement. Iterators like those in CLU are now a common feature of many modern languages, such as C#, Ruby, and Python, though recently they are often referred to as generators. CLU also includes [[exception handling]], based on various attempts in other languages; exceptions are raised using <code>signal</code> and handled with <code>except</code>. Unlike most other languages with exception handling, exceptions are not implicitly resignaled up the calling chain. Also unlike most other languages that provide exception handling, exceptions in CLU are considered part of ordinary execution flow and are considered a "normal" and efficient type-safe way to break out of loops or to return from functions; this allows for direct assignment of return values "except when" other conditions apply. Exceptions that are neither caught nor resignaled explicitly are immediately converted into a special failure exception that typically terminates the program. CLU is often credited as being the first language with type-safe [[variant type]]s, called ''oneofs'', before the language [[ML (programming language)|ML]] had them. A final distinctive feature in CLU is [[parallel assignment]] (multiple assignment), where more than one variable can appear on the left hand side of an [[Assignment (computer science)|assignment]] operator. For instance, writing <code>x,y := y,x</code> would exchange values of <code>x</code> and <code>y</code>. In the same way, functions could return several values, like {{CLU|1=x,y,z := f(t)}}. Parallel assignment (though not multiple return values) predates CLU, appearing in [[CPL (programming language)|CPL]] (1963), named ''simultaneous assignment'',<ref>{{cite journal |first1= D. W. |last1= Barron |first2= J. N. |last2= Buxton |first3= D. F. |last3= Hartley |first4= E. |last4= Nixon |first5= C. |last5= Strachey |title= The main features of CPL |journal= Computer Journal |volume= 6 |issue= 2 |pages= 134β143 |date= 1963 |doi= 10.1093/comjnl/6.2.134|doi-access= free }}</ref> but CLU popularized it and is often credited as the direct influence leading to parallel assignment in later languages. All objects in a CLU program live in the heap, and memory management is automatic. CLU supports [[generic programming|type-parameterized]] user-defined data abstractions. It was the first language to offer type-safe bounded parameterized types, using ''where clauses'' to express constraints on actual type arguments. Unlike in languages with template-based generics, a use of such a data abstraction can be type-checked without access to the implementation of the abstraction.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
CLU (programming language)
(section)
Add topic