Timeline of Composition in Various Languages
C calls a record a struct or structure; object-oriented languages such as Java, Smalltalk, and C++ often keep their records hidden inside objects (class instances); languages in the ML family simply call them records. COBOL was the first programming language to support records directly; ALGOL 68 got it from COBOL and Pascal got it, more or less indirectly, from ALGOL 68. Common Lisp provides structures and classes (the latter via the Common Lisp Object System).
- 1959 – COBOL
- 1960 – ALGOL 60
Arrays were the only composite data type in Algol 60.
- 1964 – PL/I
- 1968 – ALGOL 68
For an example of all this, here is the traditional linked list declaration:
mode node = union (real, int, compl, string), list = struct (node val, ref list next);Note that for ALGOL 68 only the newtypet name appears to the left of the equality, and most notably the construction is made – and can be read – from left to right without regard to priorities.
- 1970 – Pascal
- 1972 – K&R C
- 1977 – FORTRAN 77
Fortran 77 has arrays, but lacked any formal record/structure definitions. Typically compound structures were built up using EQUIVALENCE or COMMON statements:
CHARACTER NAME*32, ADDR*32, PHONE*16 REAL OWING COMMON /CUST/NAME, ADDR, PHONE, OWING- 1983 – ADA
- 1983 – C++
- 1991 – Python
- 1992 – FORTRAN 90
Arrays and strings were inherited from FORTRAN 77, and a new reserved word was introduced: type
type newtypet double precision a, b, c integer*2 i, j, k * No pointer type REF REAL R end type type (newtypet) t(10, 100)FORTRAN 90 updated and included FORTRAN IV's concept called NAMELIST.
INTEGER :: jan = 1, feb = 2, mar = 3, apr = 4 NAMELIST / week / jan, feb, mar, apr- 1994 – ANSI Common Lisp
Common Lisp provides structures and the ANSI Common Lisp standard added CLOS classes.
(defclass some-class ((f :type float) (i :type integer) (a :type (array integer (10)))))For more details about composition in C/C++, see Composite type.
Read more about this topic: Object Composition
Famous quotes containing the words composition and/or languages:
“The naive notion that a mother naturally acquires the complex skills of childrearing simply because she has given birth now seems as absurd to me as enrolling in a nine-month class in composition and imagining that at the end of the course you are now prepared to begin writing War and Peace.”
—Mary Kay Blakely (20th century)
“People in places many of us never heard of, whose names we cant pronounce or even spell, are speaking up for themselves. They speak in languages we once classified as exotic but whose mastery is now essential for our diplomats and businessmen. But what they say is very much the same the world over. They want a decent standard of living. They want human dignity and a voice in their own futures. They want their children to grow up strong and healthy and free.”
—Hubert H. Humphrey (19111978)