Concepts and Semantics of Programming Languages 2
Реклама. ООО «ЛитРес», ИНН: 7719571260.
Оглавление
Therese Hardin. Concepts and Semantics of Programming Languages 2
Table of Contents
List of Tables
Guide
Pages
Concepts and Semantics of Programming Languages 2. Modular and Object-oriented Constructs with OCaml, Python, C++, Ada and Java
Foreword
Preface
1. Namespaces: Model and Operations
1.1. Reusing, dividing, confining. 1.1.1.Analysis of some developer needs
1.1.1.1. Reusing
1.1.1.2. Dividing
1.1.1.3. Confining
EXAMPLE 1.1.–
1.1.2.Meeting developer needs
1.2. Namespaces
1.2.1.Namespaces definition
EXAMPLE 1.2.–
EXAMPLE 1.3.–
1.2.2.Extending notions of environment and binding
EXAMPLE 1.4.–
EXAMPLE 1.5.–
EXAMPLE 1.6.–
1.3.kitdevelopment
EXAMPLE 1.7.–
1.3.1.Namespace of akit
1.3.2.Order of fields introduction
1.3.3.Typingkits
EXAMPLE 1.8.–
1.3.4. kitvalues
EXAMPLE 1.9.–
EXAMPLE 1.10.–
1.3.5. kitexport, confining fields
EXAMPLE 1.11.–
1.3.6. kitsimport
1.3.6.1. Import operation
EXAMPLE 1.12.–
1.3.6.2. Flattening import
EXAMPLE 1.13.–
1.3.7.Stages ofkitdevelopment
1.4. Incompletekits
1.4.1.Type and value of an incompletekit
1.4.2.Completion of an incompletekit
1.4.3.Confining an incompletekit
1.5. Parameterizedkits. 1.5.1. kitsparameterized by a type
EXAMPLE 1.14.–
1.5.1.1. Case of parametric polymorphism types
EXAMPLE 1.15.–
EXAMPLE 1.16.–
EXAMPLE 1.17.–
1.5.1.2. Type variables without parametric polymorphism
EXAMPLE 1.18.–
EXAMPLE 1.19.–
1.5.2. kitsparameterized by types and values
EXAMPLE 1.20.–
EXAMPLE 1.21.–
EXAMPLE 1.22.–
1.5.3.Confinement, parametrization, incompletekitsand export
EXAMPLE 1.23.–
EXAMPLE 1.24.–
1.6. Functors ofkits
EXAMPLE 1.25.–
1.7.kitextension
1.7.1.Presentation of extension
1.7.1.1. Extension of a complete kit
1.7.1.2. Extension of an incomplete kit
1.7.1.3. Extension of a parameterized kit
EXAMPLE 1.26.–
1.7.1.4. Adding components
EXAMPLE 1.27.–
1.7.1.5. Reintroduction of fields
1.7.1.6. Extension without a back-update
EXAMPLE 1.28.–
1.7.1.7. Extension with a back-update
EXAMPLE 1.29.–
1.7.2.Confinement and extension
1.7.2.1. Sharing fields
EXAMPLE 1.30.–
1.7.2.2. Simultaneous extension of several kits
1.7.2.3. Subtyping and extension
1.8. Conclusion
2. Modules
2.1. Modules in Ada
2.1.1.Developing modules
EXAMPLE 2.1.–
EXAMPLE 2.2.–
2.1.1.1. Namespace
2.1.1.2. Type and value of a module
2.1.2.Export and confinement
EXAMPLE 2.3.–
2.1.3.Nesting modules
EXAMPLE 2.4.–
2.1.4.Importing a module
EXAMPLE 2.5.–
2.1.5.Flattening an import
EXAMPLE 2.6.–
2.1.6.1. Instantiation of a parameterized module
2.1.6.2. Module parameterized by a type
EXAMPLE 2.7.–
EXAMPLE 2.8.–
2.1.6.3. Module parameterized by a function
2.1.6.4. Module parameterized by a module, one step towards functors
EXAMPLE 2.9.–
EXAMPLE 2.10.–
2.1.7.Modules and separate compilation
2.2. Modules in OCaml
2.2.1.Module definition
EXAMPLE 2.11.–
2.2.2.Export and confinement
EXAMPLE 2.12.–
EXAMPLE 2.13.–
2.2.2.1. Signature matching
EXAMPLE 2.14.–
EXAMPLE 2.15.–
2.2.2.2. Flattening a module
EXAMPLE 2.16.–
EXAMPLE 2.17.–
2.2.2.3. Restriction on the scope ofopen
EXAMPLE 2.18.–
2.2.2.4. Nested modules
EXAMPLE 2.19.–
2.2.3.Confinement of type definitions
EXAMPLE 2.20.–
EXAMPLE 2.21.–
EXAMPLE 2.22.–
2.2.3.1. Sharing types between modules
EXAMPLE 2.23.–
2.2.4.Functors
EXAMPLE 2.24.–
EXAMPLE 2.25.–
EXAMPLE 2.26.–
EXAMPLE 2.27.–
EXAMPLE 2.28.–
EXAMPLE 2.29.–
2.3. Modularity, namespaces andW-kit
2.3.1.Declaration interfaces
2.3.2. W-kits
2.3.3.Modularity and header files in C
EXAMPLE 2.30.–
EXAMPLE 2.31.–
EXAMPLE 2.32.–
EXAMPLE 2.33.–
EXAMPLE 2.34.–
3. Class and Object Features
3.1. Object-oriented features
3.1.1.Objects
EXAMPLE 3.1.–
3.1.2.Classes
3.1.2.1. Classes, objects and their types
3.1.2.2. Object constructors
EXAMPLE 3.2.–
3.1.2.3. Confinement
3.1.2.4. Simple inheritance
EXAMPLE 3.3.–
3.1.2.5. Subclassing
3.1.2.6. Late binding
3.1.2.7. Multiple inheritance
EXAMPLE 3.4.–
EXAMPLE 3.5.–
3.1.2.8. Abstract classes, parameterized classes
3.1.2.9. Introspection and reflection
3.1.2.10. Object-oriented programs
3.2.kitsand object features
3.2.1.Modeling classes. 3.2.1.1. C-kits and classes
EXAMPLE 3.6.–
3.2.1.2. C-kit types
3.2.1.3. Instantiation ofFpandFk
3.2.1.4. Instantiation ofFa
3.2.2.Modeling objects. 3.2.2.1. O-kit and objects
3.2.2.2. Object constructors
3.2.3.Inheritance, redefinition and late binding. 3.2.3.1. Inheritance
3.2.3.2. Redefinition
3.2.3.3. Late binding
EXAMPLE 3.7.–
3.2.3.4. Confinement and inheritance
3.2.4.IncompleteC-kits, parameterizedC-kits
3.2.4.1. Interfaces
3.2.4.2. “not-defined" C-kits
3.2.4.3. Parameterized C-kits and functors
3.2.5.Subclassing, subtyping
3.2.5.1. Subclassing
3.2.5.2. Subtyping
Subtyping and assignment
Subtyping and structured data
Subtyping and methods
3.2.5.3. Coercions
3.2.5.4. Inheritance and binary methods
3.2.5.5. Overloading
3.2.6.Type languages, classes and objects
4. Classes in Selected Languages
4.1. Classes in Java. 4.1.1.General presentation
4.1.2.Modules and packages
4.1.3.Classes
4.1.3.1. Values, types and genericity
EXAMPLE 4.1.–
4.1.3.2. Object constructors
EXAMPLE 4.2.–
4.1.3.3. Binary methods
EXAMPLE 4.3.–
4.1.4.Marks. 4.1.4.1. Confinement
EXAMPLE 4.4.–
EXAMPLE 4.5.–
4.1.4.2. Other marks
EXAMPLE 4.6.–
4.1.5.Developing classes. 4.1.5.1. Abstract classes
EXAMPLE 4.7.–
4.1.5.2. Parameterized classes
EXAMPLE 4.8.–
4.1.5.3. Interfaces
EXAMPLE 4.9.–
4.1.5.4. Inheritance
4.1.5.5. Subtyping
EXAMPLE 4.10.–
EXAMPLE 4.11.–
EXAMPLE 4.12.–
4.1.5.6. Explicit type conversion
EXAMPLE 4.13.–
4.1.5.7. Overloading
EXAMPLE 4.14.–
EXAMPLE 4.15.–
4.1.5.8. Other features
4.2. Classes in C++
4.2.1.Header files, namespaces, confinement
EXAMPLE 4.16.–
EXAMPLE 4.17.–
EXAMPLE 4.18.–
4.2.2.Classes
EXAMPLE 4.19.–
EXAMPLE 4.20.–
EXAMPLE 4.21.–
EXAMPLE 4.22.–
4.2.2.1. Object constructors and destructors
4.2.3.1. Confinement
EXAMPLE 4.23.–
4.2.3.2. Inheritance
EXAMPLE 4.24.–
4.2.3.3. Reintroduction and redefinition
EXAMPLE 4.25.–
EXAMPLE 4.26.–
EXAMPLE 4.27.–
4.2.3.4. Inheritance and type conversion
EXAMPLE 4.28.–
EXAMPLE 4.29.–
4.2.3.5. Inheritance and subtyping
4.2.3.6. Incomplete C-kits, abstract classes
EXAMPLE 4.30.–
4.2.4.Overloading in C++
EXAMPLE 4.31.–
EXAMPLE 4.32.–
EXAMPLE 4.33.–
4.2.4.1. Overloading and type conversion
EXAMPLE 4.34.–
4.2.5.Parameterized classes
4.2.5.1. Type parameters
EXAMPLE 4.35.–
EXAMPLE 4.36.–
4.2.5.2. Value parameters
EXAMPLE 4.37.–
EXAMPLE 4.38.–
4.2.5.3. Inheritance from parameterized classes
EXAMPLE 4.39.–
4.2.5.4. Other features
4.3. Classes in OCaml. 4.3.1.Presentation
4.3.2.An overview of classes
EXAMPLE 4.40.–
EXAMPLE 4.41.–
4.3.2.1. Types of classes and type inference
EXAMPLE 4.42.–
EXAMPLE 4.43.–
EXAMPLE 4.44.–
EXAMPLE 4.45.–
EXAMPLE 4.46.–
EXAMPLE 4.47.–
4.3.2.2. Values of classes
EXAMPLE 4.48.–
4.3.2.3. Object constructors and initializers
EXAMPLE 4.49.–
4.3.3.Marks, incomplete classes, parametrization. 4.3.3.1. Marks The private mark
EXAMPLE 4.50.–
EXAMPLE 4.51.–
4.3.3.2. Virtual classes
EXAMPLE 4.52.–
EXAMPLE 4.53.–
EXAMPLE 4.54.–
EXAMPLE 4.55.–
EXAMPLE 4.56.–
4.3.3.3. Parameterized classes
EXAMPLE 4.57.–
EXAMPLE 4.58.–
EXAMPLE 4.59.–
EXAMPLE 4.60.–
4.3.4.Objects
EXAMPLE 4.61.–
4.3.4.1. Closed versus open object types
EXAMPLE 4.62.–
EXAMPLE 4.63.–
4.3.4.2. Subtyping and inclusion polymorphism
EXAMPLE 4.64.–
EXAMPLE 4.65.–
EXAMPLE 4.66.–
4.3.5.Class signatures: confinement and inheritance. 4.3.5.1. Confinement
EXAMPLE 4.67.–
4.3.5.2. Class signature and inheritance
EXAMPLE 4.68.–
4.3.5.3. Confinement by module signatures
EXAMPLE 4.69.–
4.3.6.Multiple inheritance
4.3.6.1. Solving ambiguities
EXAMPLE 4.70.–
4.3.6.2. Redefinitions
4.3.6.3. Remark
EXAMPLE 4.71.–
4.3.7.Other features
4.4. Presentation of Python
4.4.1.Getting started
EXAMPLE 4.72.–
4.4.2.An overview of classes, modules and types
4.4.2.1. Entities
EXAMPLE 4.73.–
4.4.2.2. Types
EXAMPLE 4.74.–
4.4.2.3. Functions
EXAMPLE 4.75.–
EXAMPLE 4.76.–
EXAMPLE 4.77.–
4.4.2.4. Classes
EXAMPLE 4.78.–
EXAMPLE 4.79.–
EXAMPLE 4.80.–
4.4.3.Names and assignment. 4.4.3.1. Namespaces, environments, bindings
EXAMPLE 4.81.–
4.4.3.2. Scope
EXAMPLE 4.82.–
EXAMPLE 4.83.–
EXAMPLE 4.84.–
EXAMPLE 4.85.–
4.4.4.Assignment and typechecking
4.4.4.1. Assignment
4.4.4.2. Typechecking
EXAMPLE 4.86.–
4.4.4.3. Mutability
EXAMPLE 4.87.–
4.4.5.Overloading
EXAMPLE 4.88.–
EXAMPLE 4.89.–
EXAMPLE 4.90.–
4.4.5.1. Duck typing
EXAMPLE 4.91.–
EXAMPLE 4.92.–
EXAMPLE 4.93.–
4.4.7.Confinement
EXAMPLE 4.94.–
4.4.8.Inheritance
EXAMPLE 4.95.–
EXAMPLE 4.96.–
4.4.9.IncompleteC-kitsand abstract classes
EXAMPLE 4.97.–
4.4.10.Other features. 4.4.10.1. Reflection, metaclasses
EXAMPLE 4.98.–
EXAMPLE 4.99.–
4.4.10.2. Evolution of the language
Appendix: Questions to Guide Learning
List of Notations
References
Index. A, B
C
E, F
G, H, I
J, K
M
N, O
P, Q
R, S
T
V
W
WILEY END USER LICENSE AGREEMENT
Отрывок из книги
Series Editor
Jean-Charles Pomerol
.....
Véronique Viguié Donzeau-Gouge
Professor at the École normale supérieure, Paris-Saclay
.....