title: Calling a recursive lambda expression
body: <p>I have this function here which sends a request</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun request(requestCode: Int, callback: (Boolean) -&gt; Unit) {
      val result = false
      // Some job...
      callback(result)
  }
  </code></pre>
  <p>apparently, this function takes a lambda expression as an argument.
  Now, when I need to call this function from the main function I have this scenario where if the callback result is true I need to do some job, and otherwise, I need to repeat the request again.</p>
  <pre class="lang-kotlin prettyprint-override"><code>fun main() {
      request(10) { result -&gt;
          if (result) {
              // Success
          } else {
              // Here I need to make the request again
              request(10) { result2 -&gt;
                  // And so on..
              }
          }
      }
  
  }
  </code></pre>
  <p>The problem now is that I need to repeat the call indefinitely!!.
  How can I solve this problem?</p>