11.3.1 Predefined constants

It is sometimes useful to define special constant values to represent situations in the code; MBFL defines the class mbfl_predefined_constant for this purpose; we can use it to define a void value as follows:

mbfl_default_object_declare(void)

mbfl_predefined_constant_define _(void)

function is_the_void () {
    mbfl_mandatory_parameter(DATAVAR, 1, a data variable)
    mbfl_datavar_eq("$DATAVAR",_(void))
}

code bases are always imperfect.

Class: mbfl_predefined_constant
Proxy Variable: mbfl_predefined_constant
Superclass: mbfl_default_object
Metaclass: mbfl_default_class

Class of objects representing unique constant values.

Function: mbfl_predefined_constant_define DEFOBJ

Define a new instance of mbfl_predefined_constant.

Function: mbfl_predefined_constant_p DEFOBJ

Return true if the parameter is the datavar of an object of class mbfl_predefined_constant; otherwise return false.

Instance Variable of mbfl_predefined_constant: mbfl_undefined

A unique value used as variable’s value to indicate an undefined value.

Instance Variable of mbfl_predefined_constant: mbfl_unspecified

A unique value used as function call parameter to indicate an unspecified value.

Function: mbfl_the_undefined_p DEFOBJ

Return true if the parameter is the data variable of mbfl_undefined; otherwise return false.

Function: mbfl_the_unspecified_p DEFOBJ

Return true if the parameter is the data variable of mbfl_unspecified; otherwise return false.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.