A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scala-lang.org/api/3.x/scala/util/boundary$.html below:

boundary

scala.util.boundary

A boundary that can be exited by break calls. boundary and break represent a unified and superior alternative for the scala.util.control.NonLocalReturns and scala.util.control.Breaks APIs. The main differences are:

Example usage:

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 break(i)
   -1
Attributes
Source
boundary.scala
Graph
Supertypes
Self type
Members list

User code should call break.apply instead of throwing this exception directly.

User code should call break.apply instead of throwing this exception directly.

Attributes
Source
boundary.scala
Supertypes

Labels are targets indicating which boundary will be exited by a break.

Labels are targets indicating which boundary will be exited by a break.

Attributes
Source
boundary.scala
Supertypes

Run body with freshly generated label as implicit argument. Catch any breaks associated with that label and return their results instead of body's result.

Run body with freshly generated label as implicit argument. Catch any breaks associated with that label and return their results instead of body's result.

Attributes
Source
boundary.scala

Abort current computation and instead return value as the value of the enclosing boundary call that created label.

Abort current computation and instead return value as the value of the enclosing boundary call that created label.

Attributes
Source
boundary.scala

Abort current computation and instead continue after the boundary call that created label.

Abort current computation and instead continue after the boundary call that created label.

Attributes
Source
boundary.scala

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4