Skip to content

Commit 7033243

Browse files
committed
docs: revised according to review.
1 parent eea019f commit 7033243

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

examples/04_functional/01_Higher-Order Functions.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ fun main() {
2222

2323
</div>
2424

25-
1. Declaring a higher-order function. It takes two integer parameters, `x` and `y`. Additionally, it takes another function `operation` as a parameter. The `operation` parameters and return type are also defined in the declaration.
26-
2. The higher order functions returns the result of `operation` invocation with the supplied agruments.
27-
3. Declaring a function that matches the `operation`signature.
28-
4. Invoking the higher-order function passing in two integer values and the function argument `::sum`. `::` is the notation that references a function by name in Kotlin.
29-
5. Invoking the higher-order function passing in a lambda as a function argument. Looks more clear, doesn't it?
25+
1. Declares a higher-order function. It takes two integer parameters, `x` and `y`. Additionally, it takes another function `operation` as a parameter. The `operation` parameters and return type are also defined in the declaration.
26+
2. The higher order function returns the result of `operation` invocation with the supplied agruments.
27+
3. Declares a function that matches the `operation`signature.
28+
4. Invokes the higher-order function passing in two integer values and the function argument `::sum`. `::` is the notation that references a function by name in Kotlin.
29+
5. Invokes the higher-order function passing in a lambda as a function argument. Looks clearer, doesn't it?
3030

3131
### Returning Functions
3232

@@ -47,8 +47,8 @@ fun main() {
4747

4848
</div>
4949

50-
1. Declaring a higher-order function that returns a function.
51-
2. Declaring a function matching the signature.
52-
3. Invoking `operation` to get the result assigned to a variable. Here `func` becomes `square` which is returned by `operation`.
53-
4. Invoking `func`. The `square` function is actually executed.
50+
1. Declares a higher-order function that returns a function.
51+
2. Declares a function matching the signature.
52+
3. Invokes `operation` to get the result assigned to a variable. Here `func` becomes `square` which is returned by `operation`.
53+
4. Invokes `func`. The `square` function is actually executed.
5454

examples/04_functional/03_extensionFunctions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Extension Functions and Properties
22

3-
Kotlin lets you add new members to any class with the [extensions](https://kotlinlang.org/docs/reference/extensions.html) mechanism. Namely, there are two types of extensions: extension functions and extension properties. They look pretty much like usual functions and properties with the only difference: you need to specify the type that you extend.
3+
Kotlin lets you add new members to any class with the [extensions](https://kotlinlang.org/docs/reference/extensions.html) mechanism. Namely, there are two types of extensions: extension functions and extension properties. They look a lot like normal functions and properties but with one important difference: you need to specify the type that you extend.
44

55
<div class="language-kotlin" theme="idea" data-min-compiler-version="1.3">
66

@@ -28,11 +28,11 @@ fun main() {
2828

2929
</div>
3030

31-
1. Defining simple models of `Item` and `Order`. `Order` can contain a collection of `Item` objects.
32-
2. Adding extension functions for the `Order` type.
33-
3. Adding an extension property for the `Order` type.
34-
4. Calling extension functions directly on an instance of `Order`.
35-
5. Accessing the extension property on an instance of `Order`.
31+
1. Defines simple models of `Item` and `Order`. `Order` can contain a collection of `Item` objects.
32+
2. Adds extension functions for the `Order` type.
33+
3. Adds an extension property for the `Order` type.
34+
4. Calls extension functions directly on an instance of `Order`.
35+
5. Accesses the extension property on an instance of `Order`.
3636

3737
It is even possible to execute extensions on `null` references. In an extension function, you can check the object for `null` and use the result in your code:
3838

0 commit comments

Comments
 (0)