# run() with receiver (scope function)

DevFeed: [run() with receiver (scope function)](<https://devfeed.tech/articles/run-with-receiver-scope-function-25022.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/run-with-receiver/>)

Author: author@typealias.com (Dave Leeds)

Published: 2017-09-03T20:04:25Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [extension-function](<https://devfeed.tech/tags/extension-function.md>), [function](<https://devfeed.tech/tags/function.md>), [http](<https://devfeed.tech/tags/http.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [library](<https://devfeed.tech/tags/library.md>), [programming](<https://devfeed.tech/tags/programming.md>), [receiver](<https://devfeed.tech/tags/receiver.md>), [scope-function](<https://devfeed.tech/tags/scope-function.md>), [scope-functions](<https://devfeed.tech/tags/scope-functions.md>)

## AI overview

This tutorial explains Kotlin's run() extension function, one of the scope functions in the Kotlin standard library. It covers the receiver object, the function's result, and using run() to initialize and execute an object, including an HTTP client example.

## Source excerpt

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. This article describes the one that's an extension function. Example val size = "Hello".run { println(this) this.length } In this example, the string "Hello" is printed, and then its length is assigned to the size variable. Characteristics When the run() extension function executes: