[Next] [Previous] [Top] [Contents] [Index]
The Cecil Language: Specification and Rationale, Version 2.1
3 Static Types
Cecil supports a static type system which is layered on top of the dynamically-typed core language. The type system's chief characteristics are the following:
- Type declarations specify the interface required of an object stored in a variable or returned from a method, without placing any constraints on its representation or implementation.
- Argument specializers for method dispatching are separate from type declarations, enabling the type system to contain as special cases type systems for traditional single-dispatching and non-object-oriented languages.
- Code inheritance can be distinct from subtyping, but the common case where the two are parallel requires only one set of declarations.
- The type checker can detect statically when a message might be ambiguously defined as a result of multiple inheritance or multiple dispatching. It does not rely on the absence of ambiguities to be correct.
- The type system can check programs statically despite Cecil's classless object model.
- Type declarations are optional, providing partial language support for mixed exploratory and production programming.
- Parameterized objects, types, and methods support flexible forms of parametric polymorphism, complementing the inclusion polymorphism supported through subtyping.
This section describes Cecil's static type system in the absence of parameterization; section 4 extends this section to cope with parameterized objects and methods. Section 3.1 presents the major goals for the type system. Section 3.2 presents the overall structure of the type system. Sections 3.3, 3.4, and 3.5 describe the important kinds of declarations provided by programmers that extend the base dynamically-typed core language described in section 2. Sections 3.6, 3.7, 3.8, and 3.9 detail the type-checking rules for the language. Section 3.10 describes how the language supports mixed statically- and dynamically-typed code.
- 3.1 - Goals
-
- 3.2 - Types and Signatures
-
- 3.3 - Type and Signature Declarations
-
- 3.4 - Special Types and Type Constructors
-
- 3.5 - Object Role Annotations
-
- 3.6 - Type Checking Messages
-
- 3.7 - Type Checking Expressions, Statements, and Declarations
-
- 3.8 - Type Checking Subtyping Declarations
-
- 3.9 - Type Checking Predicate Objects
-
- 3.10 - Mixed Statically- and Dynamically-Typed Code
-
The Cecil Language: Specification and Rationale, Version 2.1 - 25 MARCH 1997
[Next] [Previous] [Top] [Contents] [Index]
Generated with Harlequin WebMaker