Skip to content

Commit 06b736e

Browse files
committed
additional typo fixes
1 parent 5ee4706 commit 06b736e

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

features/rfc-oop-aggregates-and-assignments.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ replace initialization. But the consequence is that there's no way to ensure
2222
that a given sequence of statement is putting an object in a consistent state
2323
at 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,
2626
first in terms of performance, as assignment may not need all components to be
2727
modified. But this also limits the control over assignment logic, as the user
2828
has no way to know what was the initial state of the object or what object
2929
was initially copied from.
3030

3131
Third, Ada allows partial assignment of objects through parent views. To
3232
some 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
3434
part was changed and which part was not.
3535

3636
A related issue is the so called "Aggregate by extension" where a root object
3737
is copied into a child one with specific values provided by the aggregate,
3838
again 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

4141
To solve these issues, we propose to introduce a two step object update
4242
mechanism through a value duplication ('Clone) and post update adjustment
4343
('Adjust).
4444

4545
Note 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
4747
between classes and tagged types. Users can leverage default implementation if
4848
such 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
5050
introduces complexities in generics that now need to specify wether these
5151
restricted 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
9292
optimize to bitwise copies if clone operations are not user-defined.
9393

9494
Calls 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,
9797
but is required to allow partial copies of objects which are done today in
9898
various places Ada.
@@ -108,7 +108,7 @@ different from the legacy Ada Adjust primitive in that it has an argument
108108
refering to the initial value. Note that the From parameter of adjust is
109109
always typed after the root type of the tagged record hierarchy - indeed, the source
110110
object 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
112112
modified.
113113

114114
.. code-block:: ada
@@ -214,7 +214,7 @@ Partial Copy Assignments
214214
------------------------
215215

216216
Ada 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
218218
views 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

354354
Aggregate Assignments with Extension Copies
@@ -616,7 +616,7 @@ We looked at various ways to remove the need of temporaries, for example by
616616
introducing special constructors taking aggregate values as paramters. However,
617617
this quickly leads to the need of creating a lot of extra attributes for all
618618
situations. 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
620620
the right trade-off.
621621

622622
Drawbacks

features/rfc-oop-destructors.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ The destruction sequence works in the following way:
7676

7777
- If a type has an explicit destructor, it is first called.
7878
- If a type has components hierarchy, wether or not it has an explicit
79-
destructor, the destructor sequence is called on each components.
79+
destructor, the destructor sequence is called on each components, in
80+
reverse order of construction.
8081
- If a type is in a tagged hierarchy, wether or not it has an explicit
8182
destructor, the parent destructor sequence is called.
8283

features/rfc-oop-dispatching.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ does not support multi-parameter dispatching.
132132
Dispactching on Returned Types
133133
------------------------------
134134

135-
A tag indeterminate disatching call is illegal (as it is the case today). For
135+
A tag indeterminate dispatching call is illegal (as it is the case today). For
136136
example:
137137

138138
.. code-block:: ada
@@ -198,7 +198,7 @@ a scope where Default_Dispatching_Calls is On. For example:
198198
[... some code ...]
199199
200200
A_D.all (Obj); -- This dispatches
201-
A_ND.all (Obj); -- This doesn't dispatches
201+
A_ND.all (Obj); -- This doesn't dispatch
202202
203203
[... some code ...]
204204
@@ -221,7 +221,7 @@ Rationale and alternatives
221221
It is a potential vulnerability not to call an overriden primitive. This may
222222
lead to an object to be in an state that has not been anticipated, in particular
223223
when the role of the overriden primitive is to keep the state of the derived
224-
object consistant. It's also commonly the case in most OOP languages that
224+
object consistent. It's also commonly the case in most OOP languages that
225225
dispatching is the default expected behavior and non dispatching the exception.
226226

227227
This also fixes a common confusion in Ada, where the dispatching parameter of A

features/rfc-oop-primitives.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Guide-level explanation
1414
Class objects
1515
-------------
1616

17-
A new type of type is introduce, the `class` type. This type operates similarly
17+
A new type of type is introduced, the `class` type. This type operates similarly
1818
to tagged type (there are even situations where it can be derived from one)
1919
with a number of differences:
2020

2121
- It's always a by-constructor type
2222
- It cannot have coextensions (so no access-type discriminants)
23-
- It primitives must follow the rules of First_Controlling_Parameter
23+
- Its primitives must follow the rules of First_Controlling_Parameter
2424
- It always follows the rules of Default_Dispatching_Calls
2525
- Primitives need to be declared within its scope - operations declared outside
2626
of its scope are not primitives.
@@ -55,7 +55,7 @@ bodies. The following demonstrates the above:
5555
procedure Prim (Self : in out R; V : Integer) is
5656
begin
5757
Self.F := V;
58-
end record;
58+
end Prim;
5959
6060
procedure Prim_2 (Self : in out R; V : Integer) is
6161
begin
@@ -72,7 +72,7 @@ bodies. The following demonstrates the above:
7272
7373
Primitives declared within a type can only be called via prefix notation. When
7474
primitives are declared in a scope, there can no longer be primitives declared
75-
ouside of the scope, such declarations are non-primitives.
75+
outside of the scope, such declarations are non-primitives.
7676

7777
Scoped primitives can be referred to with their fully qualified notation (for
7878
example, when using access to suprograms or renamings), for example here as
@@ -129,8 +129,8 @@ Operators can be declared as primitives:
129129
end record;
130130
131131
type T2 is new T1 with class record
132-
procedure "=" (Left : T2; Right : T1);
133-
function "+" (Left : T2, Right : T1) return T1;
132+
function "=" (Left : T2; Right : T1) return Boolean;
133+
function "+" (Left : T2; Right : T1) return T1;
134134
end record;
135135
end P;
136136
@@ -165,7 +165,7 @@ It is possible to also scope primitives in regular records:
165165
166166
end P;
167167
168-
Declaring primities outside of regular records is still possible. It's not
168+
Declaring primitives outside of regular records is still possible. It's not
169169
possible to declare primitives within a regular tagged record.
170170

171171
Non-primitive scoped operations
@@ -221,7 +221,7 @@ of the scope of a class record cannot be called though prefix notation. Notably:
221221
Discriminants
222222
-------------
223223

224-
Disciminants of class record need to be repeated on both public and private
224+
Discriminants of class record need to be repeated on both public and private
225225
declaration views, but not their body view (similar to e.g. protected types).
226226
E.g:
227227

features/rfc-oop-super.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ can be used to make non dispatching calls. For example:
3434
end Call;
3535
3636
Note that `'Super` being used to make non dispatching calls to primitives using
37-
the parent view, it is only available is said view is of a derived type (there'S
37+
the parent view, it is only available if said view is of a derived type (there'S
3838
no primitive to call otherwise).
3939

4040
Reference-level explanation

0 commit comments

Comments
 (0)