DynBindModel: Difference between revisions
| Line 3: | Line 3: | ||
Eiffels dynamic binding is somewhat more complex than that of other languages. Its structure is still very simple and can be described by giving the relation γ: | Eiffels dynamic binding is somewhat more complex than that of other languages. Its structure is still very simple and can be described by giving the relation γ: | ||
<math>\gamma : (\mathrm{TYPE} \times \mathrm{NAME}) \rightarrow | <math>\gamma : \left(\mathrm{TYPE} \times \mathrm{NAME}\right) \rightarrow \left(\mathrm{TYPE} \rightarrow \mathrm{FEATURE}\right) </math> | ||
Relation γ contains both the static and dynamic binding part of the language. In the following feature: | Relation γ contains both the static and dynamic binding part of the language. In the following feature: | ||
| Line 21: | Line 21: | ||
In the rest of this text, the we will show how to construct the relation γ based on any given eiffel system. | In the rest of this text, the we will show how to construct the relation γ based on any given eiffel system. | ||
==Some fundamentals== | |||
We introduce the operator <math>\prec</math> | |||
Without loss of generality we can say that any Eiffel system <math>S</math> consists of a list of classes | |||
<math>\left\{ C_1, C_2 \ldots C_n \right\}</math> such that | |||
Revision as of 21:31, 1 October 2006
Motivation:
Eiffels dynamic binding is somewhat more complex than that of other languages. Its structure is still very simple and can be described by giving the relation γ:
Relation γ contains both the static and dynamic binding part of the language. In the following feature:
f (a: ANY)
do
print (a.out)
end
The static binding part of call a.out can be decribed as:
Namely an evaluation of γ with a tuple containing the static type of the call and the name. The result of this is a function. This function will be evaluated at runtime and yield the right feature according to the dynamic type of a.
In the rest of this text, the we will show how to construct the relation γ based on any given eiffel system.
Some fundamentals
We introduce the operator
Without loss of generality we can say that any Eiffel system consists of a list of classes such that