Skip to content

Commit 1aba8fa

Browse files
authored
Minor tweaks to v8 (dotnet#1441)
* Minor tweaks to V8 before publication * Update basic-concepts.md * Fix long-line wrapping * Fix long-line wrapping * Fix long-line wrapping * Fix long-line wrapping * Fix long-line wrapping * Fix long-line wrapping * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * Tweak term definitions * fix formatting * correct link
1 parent f9d1dc2 commit 1aba8fa

13 files changed

Lines changed: 76 additions & 62 deletions

standard/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 17.1 General
44

5-
An array is a data structure that contains a number of variables that are accessed through computed indices. The variables contained in an array, also called the ***elements*** of the array, are all of the same type, and this type is called the ***element type*** of the array.
5+
An array is a data structure that contains a number of variables that are accessed through computed indices. The variables contained in an array are each called an ***element*** of that array. All elements of that array have the same type, and this type is called the ***element type*** of the array.
66

77
An array has a rank that determines the number of indices associated with each array element. The rank of an array is also referred to as the dimensions of the array. An array with a rank of one is called a ***single-dimensional array***. An array with a rank greater than one is called a ***multi-dimensional array***. Specific sized multi-dimensional arrays are often referred to as two-dimensional arrays, three-dimensional arrays, and so on. Each dimension of an array has an associated length that is an integral number greater than or equal to zero. The dimension lengths are not part of the type of the array, but rather are established when an instance of the array type is created at run-time. The length of a dimension determines the valid range of indices for that dimension: For a dimension of length `N`, indices can range from `0` to `N – 1` inclusive. The total number of elements in an array is the product of the lengths of each dimension in the array. If one or more of the dimensions of an array have a length of zero, the array is said to be empty.
88

standard/attributes.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Much of the C# language enables the programmer to specify declarative information about the entities defined in the program. For example, the accessibility of a method in a class is specified by decorating it with the *method_modifier*s `public`, `protected`, `internal`, and `private`.
66

7-
C# enables programmers to invent new kinds of declarative information, called ***attributes***. Programmers can then attach attributes to various program entities, and retrieve attribute information in a run-time environment.
7+
C# enables programmers to invent new kinds of declarative information, called ***attribute***s. Programmers can then attach attributes to various program entities, and retrieve attribute information in a run-time environment.
88

99
> *Note*: For instance, a framework might define a `HelpAttribute` attribute that can be placed on certain program elements (such as classes and methods) to provide a mapping from those program elements to their documentation. *end note*
1010
@@ -145,7 +145,7 @@ Attribute classes can have ***positional parameter***s and ***named parameter***
145145
146146
### 23.2.4 Attribute parameter types
147147
148-
The types of positional and named parameters for an attribute class are limited to the ***attribute parameter types***, which are:
148+
The types of positional and named parameters for an attribute class are limited to the ***attribute parameter type***s, which are:
149149
150150
- One of the following types: `bool`, `byte`, `char`, `double`, `float`, `int`, `long`, `sbyte`, `short`, `string`, `uint`, `ulong`, `ushort`.
151151
- The type `object`.
@@ -156,9 +156,9 @@ The types of positional and named parameters for an attribute class are limited
156156
157157
## 23.3 Attribute specification
158158
159-
***Attribute specification*** is the application of a previously defined attribute to a program entity. An attribute is a piece of additional declarative information that is specified for a program entity. Attributes can be specified at global scope (to specify attributes on the containing assembly or module) and for *type_declaration*s ([§14.7](namespaces.md#147-type-declarations)), *class_member_declaration*s ([§15.3](classes.md#153-class-members)), *interface_member_declaration*s ([§19.4](interfaces.md#194-interface-members)), *struct_member_declaration*s ([§16.3](structs.md#163-struct-members)), *enum_member_declaration*s ([§20.2](enums.md#202-enum-declarations)), *accessor_declaration*s ([§15.7.3](classes.md#1573-accessors)), *event_accessor_declaration*s ([§15.8](classes.md#158-events)), elements of *parameter_list*s ([§15.6.2](classes.md#1562-method-parameters)), and elements of *type_parameter_list*s ([§15.2.3](classes.md#1523-type-parameters)).
159+
Application of a previously defined attribute to a program entity is called ***attribute specification***. An attribute is a piece of additional declarative information that is specified for a program entity. Attributes can be specified at global scope (to specify attributes on the containing assembly or module) and for *type_declaration*s ([§14.7](namespaces.md#147-type-declarations)), *class_member_declaration*s ([§15.3](classes.md#153-class-members)), *interface_member_declaration*s ([§19.4](interfaces.md#194-interface-members)), *struct_member_declaration*s ([§16.3](structs.md#163-struct-members)), *enum_member_declaration*s ([§20.2](enums.md#202-enum-declarations)), *accessor_declaration*s ([§15.7.3](classes.md#1573-accessors)), *event_accessor_declaration*s ([§15.8](classes.md#158-events)), elements of *parameter_list*s ([§15.6.2](classes.md#1562-method-parameters)), and elements of *type_parameter_list*s ([§15.2.3](classes.md#1523-type-parameters)).
160160
161-
Attributes are specified in ***attribute sections***. An attribute section consists of a pair of square brackets, which surround a comma-separated list of one or more attributes. The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications `[A][B]`, `[B][A]`, `[A, B]`, and `[B, A]` are equivalent.
161+
Attributes are specified in ***attribute section***s. An attribute section consists of a pair of square brackets, which surround a comma-separated list of one or more attributes. The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant. For instance, the attribute specifications `[A][B]`, `[B][A]`, `[A, B]`, and `[B, A]` are equivalent.
162162
163163
```ANTLR
164164
global_attributes
@@ -513,7 +513,7 @@ A class that is decorated with the `AttributeUsage` attribute shall derive from
513513
514514
#### 23.5.3.1 General
515515
516-
The attribute `Conditional` enables the definition of ***conditional methods*** and ***conditional attribute classes***.
516+
The attribute `Conditional` enables the definition of ***conditional method***s and ***conditional attribute class***es.
517517
518518
#### 23.5.3.2 Conditional methods
519519
@@ -958,7 +958,8 @@ Specifies that a given method never returns if the associated `bool` parameter h
958958
> {
959959
> if (!isNull)
960960
> {
961-
> throw new ArgumentException(argumentName, $"argument {argumentName} can't be null");
961+
> throw new ArgumentException(argumentName,
962+
> $"argument {argumentName} can't be null");
962963
> }
963964
> }
964965
>
@@ -1012,7 +1013,8 @@ Specifies that a nullable value will never be `null` if the method returns (rath
10121013
> <!-- Example: {template:"code-in-class-lib", name:"NotNullAttribute"} -->
10131014
> ```csharp
10141015
> #nullable enable
1015-
> public static void ThrowWhenNull([NotNull] object? value, string valueExpression = "") =>
1016+
> public static void ThrowWhenNull([NotNull] object? value,
1017+
> string valueExpression = "") =>
10161018
> _ = value ?? throw new ArgumentNullException(valueExpression);
10171019
>
10181020
> public static void LogMessage(string? message)
@@ -1094,7 +1096,8 @@ The iterator won’t have access to the `CancellationToken` argument for `GetAsy
10941096
> }
10951097
> }
10961098
>
1097-
> static async IAsyncEnumerable<string> GetStringsAsync([EnumeratorCancellation] CancellationToken token)
1099+
> static async IAsyncEnumerable<string> GetStringsAsync(
1100+
> [EnumeratorCancellation] CancellationToken token)
10981101
> {
10991102
> for (int i = 0; i < 10; i++)
11001103
> {

standard/basic-concepts.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The ***effective entry point*** of an application is the entry point declared wi
3939
When an application is run, a new ***application domain*** is created. Several different instantiations of an application may exist on the same machine at the same time, and each has its own application domain.
4040
An application domain enables application isolation by acting as a container for application state. An application domain acts as a container and boundary for the types defined in the application and the class libraries it uses. Types loaded into one application domain are distinct from the same types loaded into another application domain, and instances of objects are not directly shared between application domains. For instance, each application domain has its own copy of static variables for these types, and a static constructor for a type is run at most once per application domain. Implementations are free to provide implementation-defined policy or mechanisms for the creation and destruction of application domains.
4141

42-
Application startup occurs when the execution environment calls the application’s effective entry point. If the effective entry point declares a parameter, then during application startup, the implementation shall ensure that the initial value of that parameter is a non-null reference to a string array. This array shall consist of non-null references to strings, called ***application parameters***, which are given implementation-defined values by the host environment prior to application startup. The intent is to supply to the application information determined prior to application startup from elsewhere in the hosted environment.
42+
Application startup occurs when the execution environment calls the application’s effective entry point. If the effective entry point declares a parameter, then during application startup, the implementation shall ensure that the initial value of that parameter is a non-null reference to a string array. This array shall consist of non-null references to strings, called ***application parameter***s, which are given implementation-defined values by the host environment prior to application startup. The intent is to supply to the application information determined prior to application startup from elsewhere in the hosted environment.
4343

4444
> *Note*: On systems supporting a command line, application parameters correspond to what are generally known as command-line arguments. *end note*
4545
@@ -49,7 +49,7 @@ Other than the situations listed above, entry point methods behave like those th
4949

5050
## 7.2 Application termination
5151

52-
***Application termination*** returns control to the execution environment.
52+
The return of control to the execution environment is known as ***application termination***.
5353

5454
If the return type of the application’s effective entry point method is `int` and execution completes without resulting in an exception, the value of the `int` returned serves as the application’s ***termination status code***. The purpose of this code is to allow communication of success or failure to the execution environment. If the return type of the effective entry point method is `void` and execution completes without resulting in an exception, the termination status code is `0`.
5555

@@ -205,7 +205,7 @@ The textual order in which names are declared is generally of no significance. I
205205
206206
### 7.4.1 General
207207
208-
Namespaces and types have ***members***.
208+
Namespaces and types have ***member***s.
209209
210210
> *Note*: The members of an entity are generally available through the use of a qualified name that starts with a reference to the entity, followed by a “`.`” token, followed by the name of the member. *end note*
211211
@@ -546,7 +546,7 @@ The following accessibility constraints exist:
546546
547547
## 7.6 Signatures and overloading
548548
549-
Methods, instance constructors, indexers, and operators are characterized by their ***signatures***:
549+
Methods, instance constructors, indexers, and operators are characterized by their ***signature***s:
550550
551551
- The signature of a method consists of the name of the method, the number of type parameters, and the type and parameter-passing mode of each of its parameters, considered in the order left to right. For these purposes, any type parameter of the method that occurs in the type of a parameter is identified not by its name, but by its ordinal position in the type parameter list of the method. The signature of a method specifically does not include the return type, parameter names, type parameter names, type parameter constraints, the `params` or `this` parameter modifiers, nor whether parameters are required or optional.
552552
- The signature of an instance constructor consists of the type and parameter-passing mode of each of its parameters, considered in the order left to right. The signature of an instance constructor specifically does not include the `params` modifier that may be specified for the right-most parameter, nor whether parameters are required or optional.
@@ -972,7 +972,8 @@ A *namespace_or_type_name* is permitted to reference a static class ([§15.2.2.4
972972
>
973973
> interface C : A, B
974974
> {
975-
> public void Test() { NestedClass.M(); } // ambiguity between A.NestedClass and B.NestedClass
975+
> public void Test() { NestedClass.M(); } // ambiguity between
976+
> // A.NestedClass and B.NestedClass
976977
> }
977978
> ```
978979
>

0 commit comments

Comments
 (0)