August 2017
Intermediate to advanced
440 pages
10h
English
We've already mentioned that Kotlin allows LINQ-style processing. The last lambda in an argument convention is another component that aids its readability. For example, look at the following code:
strings.filter { it.length == 5 }.map { it.toUpperCase() }
It is more readable than notation that does not use the last lambda in an argument convention:
strings.({ s -> s.length == 5 }).map({ s -> s.toUpperCase() })
Again, this processing will be discussed in detail later, in Chapter 7, Extension Functions and Properties, but for now, we have learned about two features that improve its readability (the last lambda in an argument convention and the implicit name of a single parameter).
The last lambda ...
Read now
Unlock full access