All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlin.util.Standard.kt Maven / Gradle / Ivy

package kotlin

/**
 * Creates a tuple of type [Pair] from this and [that].
 *
 * This can be useful for creating [Map] literals with less noise, for example:
 * @sample test.collections.MapTest.createUsingTo
 */
public fun  A.to(that: B): Pair = Pair(this, that)

/**
 * Calls the specified function.
 */
public inline fun  run(f: () -> T): T = f()

/**
 * Execute f with given receiver
 */
public inline fun  with(receiver: T, f: T.() -> R): R = receiver.f()

/**
 * Converts receiver to body parameter
 */
public inline fun  T.let(f: (T) -> R): R = f(this)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy