title: Kotlin lambda with several parameters
body: <p>im a bit confused about kotlin lambda expression.
  Can not find a proper answer.</p>
  
  <p>In Java i can set a listener with tho parameters like that:</p>
  
  <pre><code>myObject.setListener(new MyListener() {
              @Override
              public boolean doSmth(int pos, int value) {
               switch(..) {
               ....
               }
              }
  })
  </code></pre>
  
  <p>With lambda:</p>
  
  <pre><code> myObject.setListener((p1, p2) -&gt; {
     switch(..) {
      ....
     }
  })
  </code></pre>
  
  <p>In Kotlin i can do smth like that:</p>
  
  <pre><code>myObject.setListener{p1, p2 -&gt; return@setListener false}
  </code></pre>
  
  <p>or</p>
  
  <pre><code>myObject.setListener{{p1, p2 -&gt; 
              if (p1) {
                  return@setListener true
              } else {
                  return@setListener false
              }
          }}
  </code></pre>
  
  <p>But its really ugly. Is there any way to do it easier?
  Of i can use smth like that:</p>
  
  <pre><code>myObject.setListener{p1, p2 -&gt; myFunc(p1, p2)}
  </code></pre>
  
  <p>But what if i wanna put my logic into that listener (it could be complex, not just <code>if else return</code>)</p>