diff --git a/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki b/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki index f2023ebc..5ba29772 100644 --- a/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki +++ b/documentation/current/method/eiffel-tutorial-et/et-dynamic-structure-execution-model.wiki @@ -6,7 +6,7 @@ A system with a certain static structure describes a set of possible executions. The properties of the run-time model are not just of interest to implementers; they also involve concepts directly relevant to the needs of system modelers and analysts at the most abstract levels. -==Objects, fields, values and references== +==Objects, fields, values, and references== A class was defined as the static description of a type of run-time data structures. The data structures described by a ca class are called '''instances''' of the class, which in turn is called their '''generating class''' (or just "generator"). An instance of ACCOUNT is a data structure representing a bank account; an instance of LINKED_LIST is a data structure representing a linked list. @@ -191,9 +191,9 @@ feature -- Initialization end -- class ACCOUNT1 -A create clause may list zero or more (here just one) procedures of the class. +A create clause may list zero or more (here just one) procedures of the class. -{{info|Note the use of the same keyword, create , for both a creation clause, as here, and creation instructions such as create x . }} +{{info|Note the use of the same keyword, create , for both a creation clause, as here, and creation instructions such as create x . }} In this case the original form of creation instruction, create x , is not valid any more for creating an instance of ACCOUNT1 ; you must use the form @@ -203,7 +203,7 @@ known as a creation call. Such a creation call will have the same effect as the Note that in this example all that make does is to call deposit . So an alternative to introducing a new procedure make would have been simply to introduce a creation clause of the form create deposit , elevating deposit to the status of creation procedure. Then a creation call would be of the form create x.deposit (2000) . -{{info|Some variants of the basic creation instruction will be reviewed later: instruction with an explicit type; creation expressions. See [[10 Other Mechanisms|"Creation variants", page 89]] . }} +{{info|Some variants of the basic creation instruction will be reviewed later: instruction with an explicit type; creation expressions. See [[10 Other Mechanisms#Creation_variants|"Creation variants"]] . }} ==Entities== @@ -235,14 +235,14 @@ deposit_count: INTEGER -- Number of deposits made since opening (provisional version) do if all_deposits /= Void then - Result := all_deposit.count + Result := all_deposits.count end end -The value returned by any call will be the value of the expression all_deposits . count (to be explained in detail shortly) for that call, unless all_deposits has value ensure , denoting a void reference ( / is "not equal"). +The value returned by any call will be the value of the expression all_deposits.count (to be explained in detail shortly) for that call, unless all_deposits /code> is a Void reference ( /= means "not equal"). -The default initialization rules seen earlier for attributes (see the table on page [[6 The Dynamic Structure: Execution Model|21]] ) also serve to initialize local entities and Result on routine entry. So in the last example, if all_deposits is void (as in the case on initialization with the class as given so far), Result keeps its default value of 0, which will be returned as the result of the function. +The default initialization rules seen earlier for attributes (see the table above) also serve to initialize local entities and Result on routine entry. So in the last example, if all_deposits is void (as in the case on initialization with the class as given so far), Result keeps its default value of 0, which will be returned as the result of the function. ==Calls== @@ -251,19 +251,19 @@ Apart from object creation, the basic computational mechanism, in the object-ori target.feature (argument1, ...) -where target is an entity or more generally an expression, feature is a feature name, and there may be zero or more argument expressions. In the absence of any argument the part in parentheses should be removed. +where target is an entity or more generally an expression, feature is a feature name, and there may be zero or more argument expressions. In the absence of any argument the part in parentheses should be removed. -We have already seen such calls. If the feature denotes a procedure, the call is an instruction, as in +We have already seen such calls. If the feature denotes a procedure, the call is an instruction, as in all_deposits.extend (new) -If feature denotes a query (function or attribute), the call is an expression, as in the right-hand side of +If feature denotes a query (function or attribute), the call is an expression, as in the right-hand side of Result := all_deposits.count -Following the principle of Uniform Access (page [[6 The Dynamic Structure: Execution Model|19]] ), this form is the same for calls to attributes and to functions without arguments. In this example, feature count from class DEPOSIT_LIST may indeed be implemented in either of these two ways: we can keep a count field in each list, updating it for each insertion and removal; or we can compute count , whenever requested, by traversing the list and counting the number of items. +Following the principle of Uniform Access (mentioned earlier in the section ''Objects, fields, values, and references''), this form is the same for calls to attributes and to functions without arguments. In this example, feature count from class DEPOSIT_LIST may indeed be implemented in either of these two ways: we can keep a count /code> field in each list, updating it for each insertion and removal; or we can compute count, whenever requested, by traversing the list and counting the number of items. In the case of a routine with arguments -- procedure or function -- the routine will be declared, in its class, as @@ -273,7 +273,7 @@ feature (formal1: TYPE1; ...) end -meaning that, at the time of each call, the value of each formal will be set to the corresponding actual ( formal1 to argument1 and so on). +meaning that, at the time of each call, the value of each formal will be set to the corresponding actual ( formal1 to argument1 and so on). In the routine body, it is not permitted to change the value of a formal argument, although it is possible to change the value of an attached object through a procedure call such as formal1.some_procedure ( ... ) . @@ -291,9 +291,9 @@ infix "+" (other: INTEGER): INTEGER Such a feature has all the properties and prerogatives of a normal "identifier" feature, except for the form of the calls, which is infix, as in i + j , rather than using dot notation. An infix feature must be a function, and take exactly one argument. Similarly, a function can be declared as prefix "-" , with no argument, permitting calls of the form -3 rather than (3).negated . -Predefined library classes covering basic types such as INTEGER , CHARACTER , BOOLEAN , REAL , DOUBLE are known to the Eiffel compiler, so that a call of the form j + i , although conceptually equivalent to a routine call, can be processed just as efficiently as the corresponding arithmetic expression in an ordinary programming language. This brings the best of both worlds: conceptual simplicity, enabling Eiffel developers, when they want to, to think of integers and the like as objects; and efficiency as good as in lower-level approaches. +Predefined library classes covering basic types such as INTEGER, CHARACTER, BOOLEAN, REAL, DOUBLE are known to the Eiffel compiler, so that a call of the form j + i , although conceptually equivalent to a routine call, can be processed just as efficiently as the corresponding arithmetic expression in an ordinary programming language. This brings the best of both worlds: conceptual simplicity, enabling Eiffel developers, when they want to, to think of integers and the like as objects; and efficiency as good as in lower-level approaches. -Infix and prefix features are available to any class, not just the basic types' predefined classes. For example a graphics class could use the name infix "|-|" for a function computing the distance between two points, to be used in expressions such as point1 |-| point2 . +Infix and prefix features are available to any class, not just the basic types' predefined classes. For example a graphics class could use the name infix "|-|" for a function computing the distance between two points, to be used in expressions such as point1 |-| point2 . ==Type declaration== @@ -309,11 +309,11 @@ This applies to attributes, formal arguments of routines and local entities. You Specifying such a function result type also declares, implicitly, the type for Result as used in the function's body. -What is a type? With the elements seen so far, every type is a class . INTEGER , used in the declaration of deposits_count , is, as we have seen, a library class; and the declaration all_deposits : DEPOSIT_LIST assumes the existence of a class DEPOSIT_LIST . +What is a type? With the elements seen so far, every type is a class . INTEGER, used in the declaration of deposits_count, is, as we have seen, a library class; and the declaration all_deposits : DEPOSIT_LIST assumes the existence of a class DEPOSIT_LIST . -Three mechanisms introduced below -- expanded types (page [[6 The Dynamic Structure: Execution Model|26]] ), genericity (page [[7 Genericity and Arrays|36]] ) and anchored declarations (page [[9 Inheritance|79]] ) -- will generalize the notion of type slightly. But they do not change the fundamental property that '''every type is based on a class''', called the type's '''base class'''. In the examples seen so far, each type is a class, serving as its own base class. +Three mechanisms introduced below -- expanded types, genericity, and anchored declarations -- will generalize the notion of type slightly. But they do not change the fundamental property that '''every type is based on a class''', called the type's '''base class'''. In the examples seen so far, each type is a class, serving as its own base class. -An instance of a class C is also called "an object of type C ". +An instance of a class C is also called "an object of type C". ==Type categories== @@ -355,12 +355,12 @@ In this case the value of an entity declared as n:INTEGER is not a It is also possible, for some non-expanded class C, to declare an entity as - x: expanded + x: expanded C -so that the values for x will be objects of type C , rather than references to such objects. This is our first example of a type -- expanded C -- that is not directly a class, although it is based on a class, C . The base type of such a type is C . +so that the values for x will be objects of type C, rather than references to such objects. This is our first example of a type -- expanded C -- that is not directly a class, although it is based on a class, C. The base type of such a type is C. -Note that the value of an entity of an expanded type can never be void; only a reference can. Extending the earlier terminology, an expanded entity is always '''attached to''' an object, atomic (as in the case of n:INTEGER ) or composite (as in x : expanded ACCOUNT ). +Note that the value of an entity of an expanded type can never be void; only a reference can. Extending the earlier terminology, an expanded entity is always '''attached to''' an object, atomic (as in the case of n: INTEGER ) or composite (as in x: expanded ACCOUNT). Expanded declarations make it possible to construct composite objects with subobjects, as in the following abbreviated class declaration (indexing clause and routines omitted): @@ -406,55 +406,62 @@ For entities of reference types, the value of x will be a void re For entities of expanded types, the values are objects; the object attached to x will be overwritten with the contents of the object attached to y . In the case of atomic objects, as in n := 3 with the declaration n: INTEGER , this has the expected effect of assigning to n the integer value 3 ; in the case of composite objects, this overwrites the fields for x , one by one, with the corresponding y fields. -To copy an object, use x.copy (y) which assumes that both x and y are non-void, and copies the contents of y 's attached object onto those of x 's. For expanded entities the effect is the same as that the of the assignment x := y . +To copy an object, use x.copy (y) which assumes that both x and y are non-void, and copies the contents of y's attached object onto those of x's. For expanded entities the effect is the same as that the of the assignment x := y. -A variant of the copy operation is twin . The expression y.twin produces a newly created object, initialized with a copy of the object attached to y , or a void value if y itself is void. For a reference type (the only interesting case) the returned result for non-void is y a reference to the new object. This means we may view twin as a function that performs +An operation performing similar duty to the copy is twin . The assignment + + x := y.twin + +produces a newly created object (provided that y is non-void), initialized with a copy of the object attached to y and attaches the result to x . This means we may view twin as a function that performs the following two steps: create Result - Result.copy (y) + Result.copy (Current) +The new object is created, then its content is updated to match the content of y to which the twin call is targeted. -So in the assignment x := y.twin , assuming both entities of reference types and y not void, will attach x to a '''new object''' identical to y 's attached object, as opposed to the assignment x := y which attaches x to the '''same object''' as y . +So, assuming both entities of reference types and y not void, the assignment above will attach x to a '''new object''' identical to y's attached object, as opposed to the assignment x := y which attaches x to the '''same object''' as y. -To determine whether two values are equal, use the expression x := y . For references, this comparison will yield true if the values are either both void or both attached to the same object; this is the case in the last figure in the state after the assignment, but not before. The symbol for not equal is /= , as in x /= y . -As with assignment, there is also a form that works on objects rather than references: x . is_equal ( y ) will return true when x and y are both non-void and attached to field-by-field identical objects. This can be true even when x y is not, for example, in the figure, before the assignment, if the two objects shown are field-by-field equal. +To determine whether two values are equal, use the expression x = y . For references, this comparison will yield true if the values are either both void or both attached to the same object; this is the case in the last figure in the state after the assignment, but not before. The symbol for not equal is /= , as in x /= y . -A more general variant of is_equal is used under the form equal ( x , y ). This is always defined, even if x is void, returning true whenever is_equal would but also if x and y are both void. (In contrast, x . is_equal ( y ) is not defined for void x and would, if evaluated, yield an exception as explained in [[8 Design by Contract (tm), Assertions and Exceptions|"Exception handling", page 46]] below.) +As with assignment, there is also a form that works on objects rather than references: x.is_equal (y) will return true when x and y are both non-void and attached to field-by-field identical objects. This can be true even when x = y is not, for example, in the figure, before the assignment, if the two objects shown are field-by-field equal. -Void denotes a void reference. So you can make x void through the assignment x := Void , and test whether it is void through if x = Void then ... +A more general variant of is_equal is used under the form equal (x, y) . This is always defined, even if x is void, returning true whenever is_equal would but also if x and y are both void. (In contrast, x.is_equal (y) is not defined for void x and would, if evaluated, yield an exception as explained in [[8 Design by Contract (tm), Assertions and Exceptions#Exception_handling|"Exception handling"]] below.) -Where assignment := and the equality operators = and /= were language constructions, copy , twin, is_equal , equal and ensure are '''library features''' coming from class ANY . The type of ensure , as declared in ANY , is NONE , the "bottom" type. +Void denotes a void reference. So you can make x void through the assignment x := Void, and test whether it is void through: + + if x = Void then ... -Using the redefinition mechanisms to be seen in the discussion of inheritance, a class can redefine copy and is_equal to cover specific notions of copy and equality. The assertions will ensure that the two remain compatible: after x.copy (y) , the property x .is_equal (y) must always be true. The effect of twin will automatically follow a redefinition of copy , and equal will follow is_equal . +Where assignment, := , and the equality operators, = and /= , were language constructions, copy, twin, is_equal, and equal are '''library features''' coming from class ANY . -To guarantee the original, non-redefined semantics you may use the variants standard_copy , standard_twin, standard_equal , all defined in ANY as "frozen", that is to say non-redefinable. +Void is a language keyword with built-in functionality, but it is not far out of bounds to think of Void as another feature declared in ANY , but with type of NONE, the "bottom" type. + +Using the redefinition mechanisms to be seen in the discussion of inheritance, a class can redefine copy and is_equal to cover specific notions of copy and equality. The assertions will ensure that the two remain compatible: after x.copy (y) , the property x .is_equal (y) must always be true. The effect of twin will automatically follow a redefinition of copy, and equal will follow is_equal. + +To guarantee the original, non-redefined semantics you may use the variants standard_copy, standard_twin, standard_equal, all defined in ANY as "frozen", that is to say non-redefinable. ==Deep operations and persistence== -Feature twin only duplicates one object. If some of the object's fields are references to other objects, the references themselves will be copied, not those other objects. +Feature twin only duplicates one object. If some of the object's fields are references to other objects, the references themselves will be copied, not those other objects. -It is useful, in some cases, to duplicate not just one object but an entire object structure. The expression y.deep_twin achieves this goal: assuming non-void y , it will produce a duplicate not just of the object attached to y but of the entire object structure starting at that object. The mechanism respects all the possible details of that structure, such as cyclic reference chains. Like the preceding features, deep_twin comes from class ANY . +It is useful, in some cases, to duplicate not just one object but an entire object structure. The expression y.deep_twin achieves this goal: assuming non-void y, it will produce a duplicate not just of the object attached to y but of the entire object structure starting at that object. The mechanism respects all the possible details of that structure, such as cyclic reference chains. Like the preceding features, deep_twin comes from class ANY. A related mechanism provides a powerful '''persistence''' facility. A call of the form x.store (Some_file_or_network_connection) -will store a copy of the entire object structure starting at x , under a suitable representation. Like deep_twin, procedure store will follow all references to the end and maintain the properties of the structure. The function retrieved can then be used -- in the same system, or another -- to recreate the structure from the stored version. +will store a copy of the entire object structure starting at x , under a suitable representation. Like deep_twin, procedure store will follow all references to the end and maintain the properties of the structure. The function retrieved can then be used -- in the same system, or another -- to recreate the structure from the stored version. -As the name suggests, Some_file_or_network_connection can be an external medium of various possible kinds, not just a file but possibly a database or network. The EiffelNet client-server library indeed uses the store - retrieved mechanism to exchange object structures over a network, between compatible or different machine architectures, for example a Windows client and a Unix server. +As the name suggests, Some_file_or_network_connection can be an external medium of various possible kinds, not just a file but possibly a database or network. The EiffelNet client-server library indeed uses the store - retrieved mechanism to exchange object structures over a network, between compatible or different machine architectures, for example a Windows client and a Unix server. ==Memory management== -Reference reattachments - - x := y -of the form illustrated by the figure just above can cause objects to become unreachable. This is the case for the object identified as OBJ1 on that figure (the object to which x was attached before the assignment) if no other reference was attached to it. +Reference reattachments, x := y , of the form illustrated by the figure just above can cause objects to become unreachable. This is the case for the object identified as OBJ1 on that figure (the object to which x was attached before the assignment) if no other reference was attached to it. -In all but toy systems, it is essential to reclaim the memory that has been allocated for such objects; otherwise memory usage could grow forever, as a result of creation instructions create x ... and calls to twin and the like, leading to thrashing and eventually to catastrophic termination. +In all but toy systems, it is essential to reclaim the memory that has been allocated for such objects; otherwise memory usage could grow forever, as a result of creation instructions create x ... and calls to twin and the like, leading to thrashing and eventually to catastrophic termination. -The Eiffel method suggests that the task of detecting and reclaiming such unused object space should be handled by an automatic mechanism (part of the Eiffel run-time environment), not manually by developers (through calls to procedures such as Pascal's dispose and C/C++'s free ). The arguments for this view are: +The Eiffel method suggests that the task of detecting and reclaiming such unused object space should be handled by an automatic mechanism (part of the Eiffel run-time environment), not manually by developers (through calls to procedures such as Pascal's dispose and C/C++'s free). The arguments for this view are: '''Simplicity''' : handling memory reclamation manually can add enormous complication to the software, especially when -- as is often the case in object-oriented development -- the system manipulates complex run-time data structures with many links and cycles. @@ -464,13 +471,12 @@ The Eiffel Software's implementation of Eiffel provides a sophisticated '''garba ==Information hiding and the call rule== -The basic form of computation, it has been noted, is a call of the form target.feature (...) . This is only meaningful if feature denotes a feature of the generating class of the object to which target (assumed to be non-void) is attached. The precise rule is the following: +The basic form of computation, it has been noted, is a call of the form target.feature (...) . This is only meaningful if feature denotes a feature of the generating class of the object to which target (assumed to be non-void) is attached. The precise rule is the following: + +{{rule|name=Feature Call|text=A call of the form target.feature (...) appearing in a class C is only valid if feature is a feature of the base class of target 's type, and is available to C.}} -{{note|Feature Call rule A call of the form target.feature (...) appearing in a class C is only valid if feature is a feature of the base class of target 's type, and is available to C.}} - - -The first condition simply expresses that if target has been declared as target: A then feature must be the name of one of the features of A . The second condition reflects Eiffel's application of the principles of information hiding. A feature clause, introducing one or more feature declarations, may appear not only as +The first condition simply expresses that if target has been declared as target: A then feature must be the name of one of the features of A. The second condition reflects Eiffel's application of the principles of information hiding. A feature clause, introducing one or more feature declarations, may appear not only as feature -- Comment identifying the feature category @@ -483,7 +489,7 @@ feature -- Comment identifying the feature category -but may also include a list of classes in braces, feature {A, B, ... } , as was illustrated for ACCOUNT : +but may also include a list of classes in braces, feature {A, B, ... } , as was illustrated for ACCOUNT: feature {NONE} -- Implementation @@ -491,25 +497,27 @@ feature {NONE} -- Implementation -- List of deposits since account's opening. -This form indicates that the features appearing in that clause are only '''available''' -- in the sense of available for calls, as used in the Feature Call rule -- to the classes listed. In the example feature all_deposits is only available to NONE . Because of the global inheritance structure (page [[5 The Static Picture: System Organization|15]] ) this means it is in fact available to no useful client at all, and is equivalent in practice to feature { } with an empty class list, although the form listing NONE explicitly is more visible and hence preferred. +This form indicates that the features appearing in that clause are only '''available''' -- in the sense of available for calls, as used in the Feature Call rule -- to the classes listed. In the example feature all_deposits is only available to NONE . Because of the [[5 The Static Picture: System Organization#The_global_inheritance_structure|global inheritance structure]], this means it is in fact available to no useful client at all, and is equivalent in practice to feature { } with an empty class list, although the form listing NONE explicitly is more visible and hence preferred. -With this specification a class text including the declaration acc: ACCOUNT and a call of the form + + +With this specification a class text including the declaration acc: ACCOUNT and a call of the form acc.all_deposits violates the Feature Call rule and will be rejected by the EiffelStudio compiler. -Besides fully exported features (introduced by feature ... ; without further qualification) and fully secret ones ( feature { } or feature {NONE} ), it is possible to export features selectively to some specified classes, using the specification +Besides fully exported features (introduced by feature ... ; without further qualification) and fully secret ones (feature { } or feature {NONE} ), it is possible to export features selectively to some specified classes, using the specification feature {A, B, ...} -for arbitrary classes A, B, ... This enables a group of related classes to provide each other with privileged access, without requiring the introduction of a special module category above the class level (see [[5 The Static Picture: System Organization|"Clusters", page 15]] ). +for arbitrary classes A, B, ... This enables a group of related classes to provide each other with privileged access, without requiring the introduction of a special module category above the class level (see [[5 The Static Picture: System Organization#Clusters|"Clusters"]] ). -Exporting features selectively to a set of classes A, B, ... also makes them available to the descendants of these classes. So a feature clause beginning with just feature is equivalent to one starting with feature {ANY} . +Exporting features selectively to a set of classes A, B, ... also makes them available to the descendants of these classes. So a feature clause beginning with just feature is equivalent to one starting with feature {ANY} . -These rules enable successive feature clauses to specify exports to different clients. In addition, the recommended style, illustrated in the examples of this chapter, suggests writing separate feature clauses -- regardless of their use for specifying export privileges -- to group features into separate categories. The standard style rules define a number of fundamental categories and the order in which they should appear; they include: Initialization for creation procedures, Access for general queries, Status report for boolean-valued queries, Status setting , Element change , Implementation (for selectively exported or secret features. Every feature in the EiffelBase library classes belongs to one of the predefined categories. +These rules enable successive feature clauses to specify exports to different clients. In addition, the recommended style, illustrated in the examples of this chapter, suggests writing separate feature clauses -- regardless of their use for specifying export privileges -- to group features into separate categories. The standard style rules define a number of fundamental categories and the order in which they should appear; they include: Initialization for creation procedures, Access for general queries, Status report for boolean-valued queries, Status setting, Element change, Implementation (for selectively exported or secret features. Every feature in the EiffelBase library classes belongs to one of the predefined categories. The Feature Call rule is the first of the rules that make Eiffel a '''statically typed''' approach, where the applicability of operations to objects is verified at compile time rather than during execution. Static typing is one of the principal components of Eiffel's support for reliability in software development. @@ -522,7 +530,7 @@ At any time during the execution of a system, one object is the '''current objec balance := balance + sum -appearing in the body of procedure deposit of class ACCOUNT , the name of the attribute balance , in both occurrences, denotes the balance field of the current object, assumed to be an instance of ACCOUNT . In the same way, the procedure body that we used for the creation procedure make in the ACCOUNT1 variant +appearing in the body of procedure deposit of class ACCOUNT, the name of the attribute balance, in both occurrences, denotes the balance field of the current object, assumed to be an instance of ACCOUNT. In the same way, the procedure body that we used for the creation procedure make in the ACCOUNT1 variant make (sum: INTEGER) -- Initialize account with sum . @@ -531,15 +539,15 @@ make (sum: INTEGER) end -contains a call to the procedure deposit . Contrary to earlier calls written in dot notation as target.feature (...) , the call to deposit has no explicit target; this means its target is the current object, an instance of ACCOUNT1 . Such a call is said to be '''unqualified'''; those using dot notations are '''qualified''' calls. +contains a call to the procedure deposit. Contrary to earlier calls written in dot notation as target.feature (...), the call to deposit has no explicit target; this means its target is the current object, an instance of ACCOUNT1. Such a call is said to be '''unqualified'''; those using dot notations are '''qualified''' calls. -Although most uses of the current object are implicit, a class may need to name it explicitly. The predefined expression Current is available for that purpose. A typical use, in a routine merge (other: ACCOUNT ) of class ACCOUNT , would be a test of the form +Although most uses of the current object are implicit, a class may need to name it explicitly. The predefined expression Current is available for that purpose. A typical use, in a routine merge (other: ACCOUNT ) of class ACCOUNT, would be a test of the form -if other = Current then - report_error ("Error: trying to merge an account with itself!") -else - ... Normal processing (merging two different account) ... -end + if other = Current then + report_error ("Error: trying to merge an account with itself!") + else + ... Normal processing (merging two different account) ... + end With these notions it is not hard to define precisely the overall scenario of a system execution by defining which object and routine will, at each instant, be the current object and the current routine: @@ -548,7 +556,7 @@ Starting a system execution, as we have seen, consists in creating an instance o From then on only two events can change the current object and current procedure: a qualified routine call; and the termination of a routine. -In a call of the form target.routine (...) , target denotes a certain object TC. (If not, that is to say, if the value of target is void, attempting to execute the call will trigger an exception, as studied below.) The generating class of TC must, as per the Feature Call rule, contain a routine of name routine . As the call starts, TC becomes the new current object and routine becomes the new current routine. +In a call of the form target.routine (...) , targetdenotes a certain object TC. (If not, that is to say, if the value of target is void, attempting to execute the call will trigger an exception, as studied below.) The generating class of TC must, as per the Feature Call rule, contain a routine of name routine. As the call starts, TC becomes the new current object and routine becomes the new current routine. When a routine execution terminates, the target object and routine of the most recent non-terminated call -- which, just before just before the terminated call, were the current object and the current routine -- assume again the role of current object and current routine. @@ -556,9 +564,9 @@ The only exception to the last rule is termination of the original root procedur ==Abstraction== -The description of assignments stated that in x := y the target x must be an entity. More precisely it must be a '''writable''' entity. This notion excludes formal routine arguments: as noted, a routine r (arg: SOME_TYPE) may assign to arg (reattaching it to a different object), although it can change the attached objects through calls of the form arg.procedure (...) . +The description of assignments stated that in x := y the target x must be an entity. More precisely it must be a '''writable''' entity. This notion excludes formal routine arguments: as noted, a routine r (arg: SOME_TYPE) may assign to arg (reattaching it to a different object), although it can change the attached objects through calls of the form arg.procedure (...) . -Restricting assignment targets to entities precludes assignments of the form obj.some_attribute := some_value , since the left-hand side obj.some_attribute is an expression (a feature call), not an entity: you may no more assign to obj.some_attribute than to, say, b + a -- another expression that is also, formally, a feature call. +Restricting assignment targets to entities precludes assignments of the form obj.some_attribute := some_value , since the left-hand side obj.some_attribute is an expression (a feature call), not an entity: you may no more assign to obj.some_attribute than to, say, b + a -- another expression that is also, formally, a feature call. To obtain the intended effect of such an assignment you may use a procedure call of the form obj.set_attribute (some_value) , where the base class of obj's type has defined the procedure