Packages

object Breaks extends Breaks

An object that can be used for the break control abstraction. Example usage:

import Breaks.{break, breakable}

breakable {
  for (...) {
    if (...) break
  }
}
Source
Breaks.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Breaks
  2. Breaks
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait TryBlock[T] extends AnyRef
    Definition Classes
    Breaks

Value Members

  1. def break(): Nothing

    Break from dynamically closest enclosing breakable block using this exact Breaks instance.

    Break from dynamically closest enclosing breakable block using this exact Breaks instance.

    Definition Classes
    Breaks
    Note

    This might be different than the statically closest enclosing block!

  2. def breakable(op: => Unit): Unit

    A block from which one can exit with a break.

    A block from which one can exit with a break. The break may be executed further down in the call stack provided that it is called on the exact same instance of Breaks.

    Definition Classes
    Breaks
  3. def tryBreakable[T](op: => T): TryBlock[T]

    This variant enables the execution of a code block in case of a break():

    This variant enables the execution of a code block in case of a break():

    tryBreakable {
      for (...) {
        if (...) break()
      }
    } catchBreak {
      doCleanup()
    }
    Definition Classes
    Breaks