tinyscalautils.control

Members list

Type members

Classlikes

Attributes

Source
interruptibly.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

inline def interruptibly[A](inline code: A): A

Checks for interrupts before running code.

Checks for interrupts before running code.

This can be used to make loops more responsive to interrupts, e.g.:

while condition do interruptibly {
   ...
 }

Note that the body of the loop can remain unresponsive. To deal with that, use tinyscalautils.threads.runAsync.

Attributes

Since

1.0

Source
interruptibly.scala
inline def noStackOverflow[A](inline code: A): A

Captures java.lang.StackOverflowError and replaces with tinyscalautils.lang.StackOverflowException in the given code.

Captures java.lang.StackOverflowError and replaces with tinyscalautils.lang.StackOverflowException in the given code.

Attributes

Since

1.1

Source
noStackOverflow.scala

Deprecated methods

inline def limitedStack[A](inline code: A): A

Attributes

Deprecated
true
Source
noStackOverflow.scala

Extensions

Extensions

extension [A](left: A)
infix inline def before[U](right: U): left.type

An SML-like operator that evaluates two arguments and returns the value of the first one. This is simply a mechanism to avoid naming an intermediate result: x before y is strictly equivalent to {val r=x; y; r}.

An SML-like operator that evaluates two arguments and returns the value of the first one. This is simply a mechanism to avoid naming an intermediate result: x before y is strictly equivalent to {val r=x; y; r}.

Attributes

Since

1.5.0

Source
before.scala
extension (number: Int)
infix inline def times(inline code: Any): Unit

Simple repetitions.

Simple repetitions.

Evaluates an expression a given number of times. e.g.:

42 times:
   ...

Attributes

Throws
IllegalArgumentException

if the target number is negative.

Since

1.0

Source
times.scala