Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 61
  1. with() (scope function)

    Overview The with() function is a scope function found in the Kotlin standard library.

  2. Understanding Kotlin's let(), also(), run(), and apply()

    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.

  3. apply() (scope function)

    Overview The apply() function is a commonly-used scope function defined in the Kotlin standard library.

  4. let() (scope function)

    Overview The let() function is one of a handful of scope functions defined in the Kotlin standard library.

  5. also() (scope function)

    Overview The also() function is a scope function that was introduced in Kotlin 1.1.

  6. Scope Functions

    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()

  7. run() with receiver (scope function)

    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.

  8. First-Class Function

    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.

  9. Function Reference

    Overview Kotlin supports the notion of first-class functions - functions can be saved to variables, passed into functions, and returned from functions.

  10. Higher-Order Function

    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.

  11. Java Optionals and Kotlin Nulls

    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.