[Next] [Previous] [Top] [Contents] [Index]

The Cecil Language: Specification and Rationale, Version 2.1

4 Parameterization and Parametric Polymorphism


Practical statically-typed languages need some mechanism for parameterizing objects and methods. Without some mechanism for parameterization or parametric polymorphism, programmers must resort to multiple similar implementations for abstractions such as list and array that differ only in the declared type of the collection's elements. Similarly, control structures such as if and map can be reused for a variety of argument types. Accordingly, Cecil supports the definition of parameterized object representations, method and field implementations, types, and signatures.

The next section describes Cecil's mechanism for explicit parameterization. Section 4.2 introduces Cecil's mechanism for implicit parameterization, and sections 4.3 and 4.4 describe aspects of this feature in more depth. Section 4.5 explains the interaction between parameterized objects and method lookup, section 4.6 explains the interaction between parameterized constructs and the object and method syntactic sugars. Section 4.7 discusses Cecil's version of F-bounded polymorphism.

Note: the mechanisms for parameterization in Cecil are being redesigned, using a more explicit and expressive constraint-based core. Programs using the mechanisms described in this section continue to be supported by the new type system. Part of the work on the new parameterization mechanism includes a more precise description of the type system and its checking rules.

4.1 - Explicit Parameterization
4.2 - Implicit Parameterization
4.3 - Matching Against Type Patterns
4.4 - Implicit Type Parameters in Extension Declarations
4.5 - Parameterized Objects and Method Lookup
4.6 - Parameterization and Syntactic Sugars
4.7 - F-Bounded Polymorphism

The Cecil Language: Specification and Rationale, Version 2.1 - 25 MARCH 1997
[Next] [Previous] [Top] [Contents] [Index]

Generated with Harlequin WebMaker