Creează un cont pentru a te abona la acest blog și a-i urmări articolele pe pagina Lectură.
-
Overview The with() function is a scope function found in the Kotlin standard library.
-
Kotlin’s standard library includes some often-used scope functions that are so abstract that even those who have been programming in Kotlin for a while can have a hard time keeping them straight.
-
Overview The apply() function is a commonly-used scope function defined in the Kotlin standard library.
-
Overview The let() function is one of a handful of scope functions defined in the Kotlin standard library.
-
Overview The also() function is a scope function that was introduced in Kotlin 1.1.
-
Scope functions consist of the often-used functions from Standard.kt in the Kotlin standard library that take an object and put it into a new scope, such as this or it. also() apply() let() run() (with receiver) with()
-
Overview There are two different run() functions defined in Standard.kt in the Kotlin standard library, among a handful of scope functions that are frequently used in Kotlin programming.
-
A programming language that supports first-class functions allows you to: Assign a function to a variable Pass a function to another function as an argument Return a function from another function as a result Kotlin allows you to do all three of these.
-
Overview Kotlin supports the notion of first-class functions - functions can be saved to variables, passed into functions, and returned from functions.
-
A higher-order function is a function does at least one of these: It accepts a function as an argument It returns a function as a result Kotlin supports higher-order functions.
-
When Java 8 introduced Streams for operating on collections of data, it also introduced a similar concept, Optional, which has many methods that are similar to Stream, but operates on a single value that might or might not be present.