Category:CLU
This programming language may be used to instruct a computer to perform a task.
Execution method:  Compiled (machine code) 

Garbage collected:  Yes 
Parameter passing methods:  By value 
Type safety:  Safe 
Type strength:  Strong 
Type compatibility:  Structural 
Type expression:  Explicit 
Type checking:  Static 
See Also: 

If you know CLU, please write code for some of the tasks not implemented in CLU.
CLU is a programming language developed in the 1970s at MIT by professor Barbara Liskov. It pioneered many features that are common in programming languages today.
CLU was the first language to support iterators (using the yield statement), abstract data types, parameterized types, and typesafe unions. It was also one of the first to support structured exception handling. CLU also supports *clusters*, for which it is named, and which are only one step removed from modern objectoriented classes, lacking only inheritance and instance methods. All objects live on the heap, are automatically garbagecollected, and are accessed by reference, as in Java.
Furthermore, CLU allows every operator and special form to be overloaded. All of them are just syntactic sugar for type methods, e.g. x + y
is the same as T$add(x, y)
(where T
is the type of x
), and will work as long as the T
cluster contains an appropriate add
method. CLU takes this much further than most modern languages: even an expression like foo.bar := baz
is really just a setter underneath, and is exactly equivalent to T$set_bar(foo, baz)
(where, again, T
is the type of foo
).
CLU has left its mark on many modern programming languages. C++ templates and Java and C# generics were based on CLU's parameterized types. Java's garbagecollected object model is pretty much the same as CLU's, and its exception handling also strongly resembles CLU. Python, on top of the garbagecollected objects and the exceptions, also borrowed the yield statement and the overloading mechanism.
Pages in category "CLU"
The following 209 pages are in this category, out of 209 total.
A
B
C
 Cantor set
 Catamorphism
 Character codes
 Chowla numbers
 Combinations
 Comma quibbling
 Commandline arguments
 Common list elements
 Compound data type
 Convert seconds to compound duration
 Copy stdin to stdout
 Count how many vowels and consonants occur in a string
 Create a twodimensional array at runtime
 CUSIP
 Cycle detection
D
E
F
 Factorial
 Factors of an integer
 Fibonacci nstep number sequences
 Fibonacci sequence
 Fibonacci word
 Find adjacent primes which differ by a square integer
 Find first missing positive
 Find prime n such that reversed n is also prime
 Find prime numbers of the form n*n*n+2
 Find squares n where n+1 is prime
 Find words which contain the most consonants
 Find words which contains all the vowels
 Find words which contains more than 3 e vowels
 FizzBuzz
 Floyd's triangle
 Fusc sequence
G
H
L
M
N
 N'th
 Nqueens problem
 Number reversal game
 Numbers divisible by their individual digits, but not by the product of their digits.
 Numbers in base16 representation that cannot be written with decimal digits
 Numbers which binary and ternary digit sum are prime
 Numbers whose count of divisors is prime
 Numbers with equal rises and falls
P
 Palindrome detection
 Pangram checker
 Parsing/RPN calculator algorithm
 Pascal matrix generation
 Perfect totient numbers
 Permuted multiples
 Pernicious numbers
 Pick random element
 Pig the dice game
 Playing cards
 Population count
 Primality by trial division
 Primality by Wilson's theorem
 Prime numbers which contain 123
 Primorial numbers
 Priority queue
 Pseudorandom numbers/Middlesquare method
R
S
 Safe primes and unsafe primes
 Search a list
 Sequence of nonsquares
 Shift list elements to left by 3
 Show ASCII table
 Show the (decimal) value of a number of 1s appended with a 3, then squared
 Sierpinski triangle
 Sieve of Eratosthenes
 Sleeping Beauty problem
 Smallest power of 6 whose decimal expansion contains n
 Smallest square that begins with n
 Smith numbers
 Sort the letters of string in alphabetical order
 Sort three variables
 Sorting algorithms/Bubble sort
 Sorting algorithms/Heapsort
 Sorting algorithms/Insertion sort
 Soundex
 Special Divisors
 Split a character string based on change of character
 Square but not cube
 Stack
 Steady Squares
 SternBrocot sequence
 Strange numbers
 Subleq
 Sum and product of an array
 Sum data type
 Sum of a series
 Sum of divisors
 Sum of first n cubes
 Sum of square and cube digits of an integer are primes
 Sum of squares
 Sum of the digits of n is substring of n
 Summarize and say sequence
 Summation of primes
 System time