41. Assert once

The assert_once module implements single-time assertion infrastructure.

All functions and symbols are in “assert_once” module, use require to get access to it.

require daslib/assert_once

41.1. Function annotations

AssertOnceMacro

This macro convert assert_once(expr,message) to the following code:

var __assert_once_I = true  // this is a global variable
if __assert_once_I && !expr
    __assert_once_I = false
    assert(false,message)

41.2. Assertion

assert_once(expr: bool const; message: string const)

argument

argument type

expr

bool const

message

string const

Same as assert, only the check will be not be repeated after the asseretion failed the first time.