Misc Functions

Additional utilities

proc compilerError(param x: c_string ...?n)

Generate a compile-time error. The error text is a concatenation of the arguments.

proc compilerError(param x: c_string ...?n, param errorDepth: int)

Generate a compile-time error. The error text is a concatenation of the string arguments.

Arguments:errorDepth -- controls the depth of the error stack trace
proc compilerWarning(param x: c_string ...?n)

Generate a compile-time warning. The warning text is a concatenation of the arguments.

proc compilerWarning(param x: c_string ...?n, param errorDepth: int)

Generate a compile-time warning. The warning text is a concatenation of the string arguments.

Arguments:errorDepth -- controls the depth of the error stack trace
proc compilerAssert(param test: bool)

This function is used primarily within system modules to test a compile time property. An error message is generated if the property is false

Arguments:test -- the param value to be tested
proc compilerAssert(param test: bool, param arg1: integral)

This function is used primarily within system modules to test a compile time property. An error message is generated if the property is false. The second parameter, which must be integral, is used to control the depth of the error stack traceback.

Arguments:test -- the param value to be tested
proc compilerAssert(param test: bool, param arg1)

This function of two arguments will be used if the second parameter is not integral. If the first parameter is false, then the second parameter is included in the error message that is generated

Arguments:test -- the param value to be tested
proc compilerAssert(param test: bool, param arg1, param arg2)

Generate a compile-time error if test is false. The error message includes arg1 and arg2.

proc compilerAssert(param test: bool, param arg1, param arg2, param arg3)

Generate a compile-time error if test is false. The error message includes arg1, arg2, arg3.

proc compilerAssert(param test: bool, param arg1, param arg2, param arg3, param arg4)

Generate a compile-time error if test is false. The error message includes arg1 through arg4.

proc compilerAssert(param test: bool, param arg1, param arg2, param arg3, param arg4, param arg5)

Generate a compile-time error if test is false. The error message includes arg1 through arg5.

proc compilerAssert(param test: bool, param arg1, param arg2, param arg3, param arg4, param arg5, argrest ...)

This variation accepts any number of arguments. The first five additional parameters are included if an error message is generated and then there is an indication that there are additional parameters.

Arguments:test -- the param value to be tested
proc compilerAssert(param test: bool, param arg1, param arg2, param arg3, param arg4, param arg5, param arg6: integral)

This variation accepts the value to be tested, precisely 5 values to be included in the error message, and finally an integral value that controls the depth of the error stack.

Arguments:test -- the param value to be tested
proc compilerAssert(param test: bool, param arg1, param arg2, param arg3, param arg4, param arg5, argrest ..., param arglast: integral)

This variation accepts any number of arguments but detects that the final argument is integral. In this version the final argument is treated as an errorDepth as for compilerWarning() and compilerError()

Arguments:test -- the param value to be tested
proc min(x, y ...)

Compute the minimum value of 2 or more arguments using the < operator for comparison.

proc max(x, y ...)

Compute the maximum value of 2 or more arguments using the > operator for comparison.

proc exit(status: int)

Exit the program

Arguments:status -- The exit code for the program