From Kotlin in Action by Dmitry Jemerov and Svetlana Isakova
The key idea of this article is the concept of higher-order functions. A higher-order function is a function that takes another function as an argument or returns one.
From Kotlin in Action by Dmitry Jemerov and Svetlana Isakova
The functional style provides many benefits when it comes to manipulating collections. You can use library functions for most tasks and simplify your code. In this article, we’ll discuss some of the functions in the Kotlin standard library for working with collections.
From Kotlin in Action by Dmitry Jemerov and Svetlana Isakova
The Java platform defines several methods that need to be present in many classes and are usually implemented in a mechanical way, such as equals
, hashCode
, and toString
. Fortunately, Java IDEs can automate the generation of these methods, and you usually don’t need to write them by hand. In this case, your codebase contains the boilerplate code. The Kotlin compiler takes a further step: it can perform the mechanical code generation, behind the scenes, without cluttering your source code files with the results.