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:
“At painful times, when composition is impossible and reading is not enough, grammars and dictionaries are excellent for distraction.”
—Elizabeth Barrett Browning (18061861)
“Science and technology multiply around us. To an increasing extent they dictate the languages in which we speak and think. Either we use those languages, or we remain mute.”
—J.G. (James Graham)