"Opposite" for with called let.
This commit is contained in:
@@ -56,3 +56,8 @@ public inline fun <T> run(f: () -> T) : T = f()
|
||||
* Execute f with given receiver
|
||||
*/
|
||||
public inline fun <T, R> with(receiver: T, f: T.() -> R) : R = receiver.f()
|
||||
|
||||
/**
|
||||
* Converts receiver to body parameter
|
||||
*/
|
||||
public inline fun <T:Any, R> T.let(f: (T) -> R): R = f(this)
|
||||
|
||||
Reference in New Issue
Block a user