Algosim documentation: assert

assert

Verifies that a condition is true.

Syntax

Description

If b is true, then assert(b, s) returns null; otherwise, assert(b, s) raises an error with message s.

Examples

assert(n > 0, "n must be positive")
failure
n must be positive
Call stack: assert

See also