Scala 3, Programming Scala.
Martin’s talk, which is also discussed in the API. I have added this example and some tests in the Programming Scala code examples here and here. import scala.util.boundary, boundary.break def firstIndex[T](xs: List[T], elem: T): Int = boundary: for (x, i) <- xs.zipWithIndex do if x == elem then