First page Back Continue Last page Summary Graphics
Types and values (2)
User defined:
- structs: point = { x: int; y: int }
- enums, ranges: bool = { false, true }
- datatypes: tree(a) = leaf(a) | node(tree(a),tree(a))
Subtyping
- 3dpoint = { x: int; y: int; z: int }
- can be used when a point (see above) is expected
Abstract types
Notes:
Current trend: simplification/unification of low-level types:
Perl blurs int/double
Scheme & Ruby blurs int/bigint
Name vs structural equivalence is less a problem when mostly everything is abstract
History:
Records: Cobol (already instanciated)
Lists: Lisp
Pointers: PL/I
User defined: Algol 68
Abstract types: Simula 67