.. default-domain:: chpl .. module:: Builtins :synopsis: This module contains built-in functions. Builtins ======== .. note:: All Chapel programs automatically ``use`` this module by default. An explicit ``use`` statement is not necessary. This module contains built-in functions. .. function:: proc assert(test: bool) Assert that a boolean condition is true. If it is false, prints 'assert failed' and halts the program. .. note :: In the current implementation, this assert never becomes a no-op. That is, using it will always incur execution-time checks. :arg test: the boolean condition :type test: `bool` .. function:: proc assert(test: bool, args ...?numArgs) Assert that a boolean condition is true. If it is false, prints 'assert failed - ' followed by all subsequent arguments, as though printed using :proc:`~ChapelIO.write()`. .. note :: In the current implementation, this assert never becomes a no-op. That is, using it will always incur execution-time checks. :arg test: the boolean condition :type test: `bool` :arg args: other arguments to print .. function:: proc compilerError(param msg: string ...?n, param errorDepth: int) Generate a compile-time error. The error text is a concatenation of the string arguments. :arg errorDepth: controls the depth of the error stack trace .. function:: proc compilerError(param msg: string ...?n) Generate a compile-time error. The error text is a concatenation of the arguments. .. function:: proc compilerWarning(param msg: string ...?n, param errorDepth: int) Generate a compile-time warning. The warning text is a concatenation of the string arguments. :arg errorDepth: controls the depth of the error stack trace .. function:: proc compilerWarning(param msg: string ...?n) Generate a compile-time warning. The warning text is a concatenation of the arguments. .. function:: proc compilerAssert(param test: bool) Generate a compile-time error if the `test` argument is false. .. function:: proc compilerAssert(param test: bool, param errorDepth: int) Generate a compile-time error if the `test` argument is false. :arg errorDepth: controls the depth of the error stack trace .. function:: proc compilerAssert(param test: bool, param msg: string ...?n) Generate a compile-time error if the `test` argument is false. The warning text is a concatenation of the string arguments. .. function:: proc compilerAssert(param test: bool, param msg: string ...?n, param errorDepth: int) Generate a compile-time error if the `test` argument is false. The warning text is a concatenation of the string arguments. :arg errorDepth: controls the depth of the error stack trace .. function:: proc exit(status: int = 0) Exit the program :arg status: The exit code for the program