2.3. stop

The stop expression does nothing. Execution of stop immediately halts silently.

2.3.1. Syntax

[2]Stop::= stop  

2.3.2. Type

stop has type Bot.

2.3.3. Examples

Print Silently
{-  
  Print three numbers in sequence, and then halt without publishing
  a signal from Println. 
-}

Println("1") >> 
Println("2") >> 
Println("3") >>
stop

{-
OUTPUT:
1
2
3
-}
Square Root
{-  Define a square root function which halts silently if 
    its argument is negative.
-}

def squareroot(n) = if (n <: 0) then stop else (n ** 0.5)

squareroot(-1)

{-
OUTPUT:
-}

2.3.4. Related Links

Related Tutorial Sections