.. default-domain:: chpl

.. module:: UtilMisc_forDocs
   :synopsis: Additional utilities

Misc Functions
==============


Additional utilities


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

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

.. function:: 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.
   
   :arg errorDepth: controls the depth of the error stack trace
   

.. function:: proc compilerWarning(param x: c_string ...?n)

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

.. function:: 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.
   
   :arg errorDepth: controls the depth of the error stack trace
   

.. function:: 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
   
   :arg test: the param value to be tested
   

.. function:: 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.
   
   :arg test: the param value to be tested
   

.. function:: 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
   
   :arg test: the param value to be tested
   

.. function:: 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`. 

.. function:: 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`. 

.. function:: 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`. 

.. function:: 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`. 

.. function:: 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.
   
   :arg test: the param value to be tested
   

.. function:: 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.
   
   :arg test: the param value to be tested
   

.. function:: 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()
   
   :arg test: the param value to be tested
   

.. function:: proc min(x, y ...)

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

.. function:: proc max(x, y ...)

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

.. function:: proc exit(status: int)

   
   Exit the program
   
   :arg status: The exit code for the program
   

