Topic: type parameter

topics > computer science > data > Group: procedure and type-valued variables

type inheritance

abstract data type
automatic selection of algorithm for abstract data type
generic operations and polymorphism
interface type
object-oriented templates and containers
type variable


A type parameter specifies a type for a generic procedure, template, or container. The compiler or run-time system instantiates data objects and procedures as needed for the specified type. For example, binary search may be defined for any ordered data structure with random access. The container 'vector' is a vector of integers.

Generics may be restricted to interface types. (cbb 7/06)

Subtopic: parameterized type up

Quote: type parameters are needed for a general, type definition facility [»demeA_1978]
Quote: a scheme is a parameterized type in which parameters can themselves be types; e.g., stack(integer) [»chanE3_1978]
Quote: apply a functor to a polymorphic, scalar product to get a real or boolean scalar product [»fostJM6_1977]
Quote: define a parameterized type which becomes a specific type when given a type argument [»fostJM6_1977]
Quote: CLU has type generators which are like clusters with type parameters [»liskBH2_1976, OK]
Quote: a scheme's parameters can be types, procedures, and any other value known at compile time
Quote: a scheme with type and procedure parameters is expanded into an instance, either type or constant [»mitcJG_1977]
Quote: a data type cluster in Alphard is a form with type parameters [»shawM6_1976, OK]
Quote: should be able to define a stack with a parameter for the element type [»shawM3_1976]
Quote: in ECL, any object can take a mode-valued variable as an argument [»wegbB5_1974, OK]
Quote: Eiffel's generic classes have type parameters; can restrict a type parameter to descendants of a given class [»meyeB9_1990]
QuoteRef: liskBH2_1976 ;;14 basic type generator is array (type) is array (int) or array (string)
Quote: a param-type is a set of possible assignments to parameterized modes; e.g., all arrays of varying element types and bounds [»parnDL3_1976]

Subtopic: type parameter as interface up

Quote: define parameters as interfaces instead of classes; greater flexibility without copy operations [»blocJ_2001]
Quote: Modula-3's generics interact with interfaces and modules, not with the type system; avoids complications of every construct accepting every kind of entity as a parameter [»nelsG_1991]
Quote: a generic module in Module-3 only takes interfaces as parameters; independent, typechecked compilation [»nelsG_1991]
Quote: CLU type-checks parameterized types via a 'where' clause that defines the required operations [»liskB_1996]
Quote: use a 'where' clause to specify a type parameter; defines the required operations for conforming types [»rodrNR8_1993]
Quote: in polymorphic procedures, can declare a set of operations required of a data type parameter [»demeA_1978]
Quote: within a polymorphic procedure, a type parameter is a type with a given set of operations [»demeA_1978]
Quote: a type parameter stands for a set of operations used within the procedure's body; similar to procedure parameters [»demeA_1978]
QuoteRef: johnRI3_1976 ;;41 with type parameters if an operation is not valid it will not cause an error until use
QuoteRef: gescCM6_1975 ;;33 array, record, procedure and pointer types-- these can all be used in literals of type TYPE (eg proc. shows general form of procedure)

Subtopic: class as parameterized type up

Quote: is class (i.e., type + extent) a parameterized data type like 'array of int'? [»buneP5_1986]

Subtopic: dependent name up

Quote: within a template, x*x is a dependent name that depends on the type parameter; * is an implicit parameter [»dosrG1_2006]

Subtopic: restriction on type up

Quote: template concepts restrict the allowable types; e.g., Assignable with Assignable as true [»dosrG1_2006]
Quote: define use patterns that a type must implement; e.g., 'p++=v' or 'bool b = (p != q);' [»dosrG1_2006]

Subtopic: container class up

Quote: a container class holds objects of another type (e.g., lists, arrays, sets); the type is irrelevant to the definer and crucial to the user [»stroB_1991]
Quote: define a container class with a type parameter; e.g., a C++ template
Quote: Java does not support specialized, homogeneous container classes [»alexRT1_2000]
Quote: to define vectors: vector is distinct from vector, constructed by a library, with v[i], and destruction when done [»koenA12_1995]

Subtopic: unspecified type, initialized type up

Quote: allow the type of a data structure element to be unspecified (? type) [»joneAK4_1976, OK]
Quote: Alphard allows initialized types; i.e., it is constant once defined [»wulfWA6_1976, OK]
QuoteRef: kiebRB9_1973 ;;4.2 parameterized type eg P(x): -> allows pointer to any named type

Related Topics up

Group: parameters   (10 topics, 145 quotes)
Group: type inheritance   (13 topics, 394 quotes)

Topic: abstract data type (64 items)
Topic: arrays (58 items)
Topic: automatic selection of algorithm for abstract data type (7 items)
Topic: generic operations and polymorphism (67 items)
Topic: interface type (50 items)
Topic: object-oriented templates and containers (27 items)
Topic: type variable
(5 items)

Updated barberCB 3/06
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.