diff --git a/courses/fundamentals_of_ada/180_polymorphism/01-introduction.rst b/courses/fundamentals_of_ada/180_polymorphism/01-introduction.rst index 9faac8fc9..526e7c662 100644 --- a/courses/fundamentals_of_ada/180_polymorphism/01-introduction.rst +++ b/courses/fundamentals_of_ada/180_polymorphism/01-introduction.rst @@ -8,9 +8,6 @@ Introduction * :ada:`'Class` operator to categorize :dfn:`classes of types` * Type classes allow dispatching calls - - - Abstract types - - Abstract subprograms - -* Runtime call dispatch vs compile-time call dispatching +* :dfn:`Static dispatch` at compile-time (overloading) +* :dfn:`Dynamic dispatch` at run-time diff --git a/courses/fundamentals_of_ada/180_polymorphism/02-classes_of_types.rst b/courses/fundamentals_of_ada/180_polymorphism/02-classes_of_types.rst index eacd08f2e..03a183c9a 100644 --- a/courses/fundamentals_of_ada/180_polymorphism/02-classes_of_types.rst +++ b/courses/fundamentals_of_ada/180_polymorphism/02-classes_of_types.rst @@ -7,8 +7,8 @@ Classes ---------- * In Ada, a Class denotes an inheritance subtree -* Class of `Root` is the class of `Root` and all its children -* Type :ada:`Root'Class` can designate any object typed after type of class of `Root` +* Class of :ada:`Root` is the class of :ada:`Root` and all its children +* Type :ada:`Root'Class` can designate any object typed after type of class of :ada:`Root` .. code:: Ada @@ -21,10 +21,10 @@ Classes -- Child2'Class = {Child2} -- Grand_Child1'Class = {Grand_Child1} -* Objects of type :ada:`Root'Class` have at least the properties of `Root` +* Objects of type :ada:`Root'Class` have at least the properties of :ada:`Root` - - Components of `Root` - - Primitives of `Root` + - Components of :ada:`Root` + - Primitives of :ada:`Root` ----------------- Indefinite Type @@ -62,7 +62,7 @@ Testing the Type of an Object ------------------------------- * The tag of an object denotes its type -* It can be accessed through the `'Tag` attribute +* It can be accessed through the :ada:`'Tag` attribute * Applies to both objects and types * Membership operator is available to check the type against a hierarchy @@ -139,15 +139,15 @@ Abstract Types Ada Vs C++ Relation to Primitives ------------------------ -Warning: Subprograms with parameter of type `Root'Class` are not primitives of `Root` +.. warning:: Subprograms with parameter of type :ada:`Root'Class` are not primitives of :ada:`Root` - .. code:: Ada +.. code:: Ada - type Root is tagged null record; - procedure Not_A_Primitive (Param : Root'Class); - type Child is new Root with null record; - -- This does not override Not_A_Primitive! - overriding procedure Not_A_Primitive (Param : Child'Class); + type Root is tagged null record; + procedure Not_A_Primitive (Param : Root'Class); + type Child is new Root with null record; + -- This does not override Not_A_Primitive! + overriding procedure Not_A_Primitive (Param : Child'Class); ---------------------------- 'Class and Prefix Notation diff --git a/courses/fundamentals_of_ada/180_polymorphism/03-dispatching_and_redispatching.rst b/courses/fundamentals_of_ada/180_polymorphism/03-dispatching_and_redispatching.rst index fd6110534..a14a22fc3 100644 --- a/courses/fundamentals_of_ada/180_polymorphism/03-dispatching_and_redispatching.rst +++ b/courses/fundamentals_of_ada/180_polymorphism/03-dispatching_and_redispatching.rst @@ -6,7 +6,7 @@ Dispatching and Redispatching Calls on Class-Wide Types (1/3) --------------------------------- -* Any subprogram expecting a `Root` object can be called with a :ada:`Animal'Class` object +* Any subprogram expecting a :ada:`Root` object can be called with a :ada:`Animal'Class` object .. code:: Ada @@ -27,7 +27,8 @@ Calls on Class-Wide Types (2/3) --------------------------------- * The *actual* type of the object is not known at compile time -* The *right* type will be selected at run-time + + - It will be selected at run-time .. container:: columns