Re-inventing the wheel: Binary search in Scala
You're doing a number of things that are very un-Scalaesque, chief among them:


mutable variables - using var instead of val
while loop - recursion is usually preferred
basic comparison operators can be used on strings - &gt;, &lt;, ==, etc.


There are also efficiency issues to be considered:


indexing into a List is slow - Vector and Array collections are better
mixed binary search - many implementations abandon the binary search and go into a straight linear search when the field of candidates becomes small enough.


With a few of these things in mind, here's an alternative approach. (A full binary search, just for simplicity.)

def checker(name: String, names: Seq[String]) : Boolean = {
  // sort the input once, use Array for fast indexing
  val arr: Array[String] = names.sorted.toArray

  // tail-recursive binary search for name in names
  def search(start: Int = 0, end: Int = arr.length -1): Boolean = {
    val mid = start + (end-start)/2
    if (start &gt; end)           false                // can't be found
    else if (arr(mid) == name) true                 // found
    else if (arr(mid) &gt; name)  search(start, mid-1) // narrow the field
    else                       search(mid+1, end)
  }
  search()  // do it
}


Result:

val lines = List("ally", "ben", "albert", "zong", "hermit", "??ennis", "123pat", "alfred", "zil", "zol", "zal")
checker("zong", lines)  // res0: Boolean = true
checker("zing", lines)  // res1: Boolean = false