title: Checking the array size and list size inside a when statement in Kotlin
body: <p>I am new to Kotlin and programming in general.
  I really like the idea of pattern matching and as you can see at the code below, I was experimenting with the when statement.  </p>
  
  <pre><code>fun main(args: Array&lt;String&gt;) {
  
  
      val myAr = arrayOf(1,2,3)
      val myL = listOf(1,2,3)
  
      fun probablyBlind() {
  
         when(myL.size != myAr.size) {
  
            myL.size &gt; myAr.size -&gt; {
              println("myL.size &gt; myAr.size = ${myL.size &gt; myAr.size}")
            }
            myL.size &lt; myAr.size -&gt; myAr.forEach { println(it) }
        }
  
        if(myL.size != myAr.size) {
          println("Inside if. myL.size &gt; myAr.size = 
          ${myL.size &gt; myAr.size}")
        }
     }
  
     probablyBlind()
   }
  </code></pre>
  
  <p>If you run the code the result is :</p>
  
  <pre><code>myL.size &gt; myAr.size = false
  </code></pre>
  
  <p>So that means that at some point the size of the list is different from the size of the array. 
  Then it evaluates to true the first comparison inside the when statement.
  But then it prints out false. Which means it shouldn't run this part of the code.
  The if statement never evaluates to true. </p>
  
  <p>Can anyone help me with this please?
  Maybe it's something really easy that I can't see at the moment. 
  If that's the case, excuse me.   </p>