@@ -22,31 +22,31 @@ replace initialization. But the consequence is that there's no way to ensure
2222that a given sequence of statement is putting an object in a consistent state
2323at creation time (unlike traditional constructors).
2424
25- Second Adjust perform a post-copy update to a type. This causes a double issue,
25+ Second, Adjust perform a post-copy update to a type. This causes a double issue,
2626first in terms of performance, as assignment may not need all components to be
2727modified. But this also limits the control over assignment logic, as the user
2828has no way to know what was the initial state of the object or what object
2929was initially copied from.
3030
3131Third, Ada allows partial assignment of objects through parent views. To
3232some respect, this is also an issue, as the resulting object may be inconsistent,
33- with only part updated, and potentially now way in Adjust to understand which
33+ with only part updated, and potentially no way in Adjust to understand which
3434part was changed and which part was not.
3535
3636A related issue is the so called "Aggregate by extension" where a root object
3737is copied into a child one with specific values provided by the aggregate,
3838again here with no control over the consistency of values (not even in Adjust
39- in the case of initialiation ).
39+ in the case of initialization ).
4040
4141To solve these issues, we propose to introduce a two step object update
4242mechanism through a value duplication ('Clone) and post update adjustment
4343('Adjust).
4444
4545Note that this extra complexity is driven from the desire to support natively
46- Ada constructions (aggregates, partial copie , etc) and improve compatibility
46+ Ada constructs (aggregates, partial copies , etc) and improve compatibility
4747between classes and tagged types. Users can leverage default implementation if
4848such level of control is unecessary. Some language extension may also allow
49- to forbig aggregates and partial update on specific types (although this
49+ to forbid aggregates and partial update on specific types (although this
5050introduces complexities in generics that now need to specify wether these
5151restricted types are allowed or not).
5252
@@ -92,7 +92,7 @@ calls clone operation of all the components one by one. The compiler is free to
9292optimize to bitwise copies if clone operations are not user-defined.
9393
9494Calls to 'Clone are statically resolved when used on definite views, and
95- dynamcially resolved on 'Class wide type. This is arguably a departure from the
95+ dynamically resolved on 'Class wide type. This is arguably a departure from the
9696"all calls are dispatching" requirement from other aspects of the OOP design,
9797but is required to allow partial copies of objects which are done today in
9898various places Ada.
@@ -108,7 +108,7 @@ different from the legacy Ada Adjust primitive in that it has an argument
108108refering to the initial value. Note that the From parameter of adjust is
109109always typed after the root type of the tagged record hierarchy - indeed, the source
110110object may be higher up in the derivation chain in the case of partial
111- copy. This value value is provided for reference but is not expected to be
111+ copy. This value is provided for reference but is not expected to be
112112modified.
113113
114114.. code-block :: ada
@@ -214,7 +214,7 @@ Partial Copy Assignments
214214------------------------
215215
216216Ada dynamically checks for tags compatibility in the context of two 'Class
217- types, which can only be assigned if there are of the same type. However, if the
217+ types, which can only be assigned if they are of the same type. However, if the
218218views are definite, the assignment is partial. For example:
219219
220220.. code-block :: ada
@@ -348,7 +348,7 @@ A few notes on the above sequences:
348348 destructor, adjust and clone attributes is somewhat heavy, as the aggregate
349349 needs to be fully initialized before cloned, then reclaimed. It's important
350350 to have self consistency here. However, developer may prefer to reserve
351- aggregate notation for types that do not require these constructions , and
351+ aggregate notation for types that do not require these constructs , and
352352 the compiler should optimize the sequencing in these cases.
353353
354354Aggregate Assignments with Extension Copies
@@ -616,7 +616,7 @@ We looked at various ways to remove the need of temporaries, for example by
616616introducing special constructors taking aggregate values as paramters. However,
617617this quickly leads to the need of creating a lot of extra attributes for all
618618situations. In light of the added complexity, and the fact that we can
619- provide means to acheive desired optimization when needed, it didn't look like
619+ provide means to achieve desired optimization when needed, it didn't look like
620620the right trade-off.
621621
622622Drawbacks
0 commit comments