truefalse - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

convert/truefalse

convert an expression to a value of type `truefalse'

 Calling Sequence convert( expr, 'truefalse' )

Parameters

 expr - any Maple expression that can be evaluated as a boolean

Description

 • The function convert( expr, 'truefalse' ) attempts to convert the expression expr to one of the two values true and false. This is intended to be used in composition with procedures that return a boolean literal that can include the value FAIL. The value FAIL is replaced by the value false.
 • The argument expression expr must be an expression that can be evaluated as a boolean, resulting in one of the values true, false, or FAIL. If $\mathrm{evalb}\left(\mathrm{expr}\right)$ returns true, then the conversion also returns the value true. Otherwise, the conversion returns the value false.

Examples

 > $\mathrm{convert}\left(\mathrm{true},'\mathrm{truefalse}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{convert}\left(\mathrm{false},'\mathrm{truefalse}'\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{convert}\left(\mathrm{FAIL},'\mathrm{truefalse}'\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{convert}\left(2<3,'\mathrm{truefalse}'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{convert}\left(a
 > $\mathrm{sort}\left(\left[\mathrm{posint},\mathrm{integer},\mathrm{numeric},\mathrm{string}\right],\mathrm{subtype}\right)$
 $\left[{\mathrm{string}}{,}{\mathrm{posint}}{,}{\mathrm{integer}}{,}{\mathrm{numeric}}\right]$ (5)
 > $\mathrm{sort}\left(\left[\mathrm{posint},\mathrm{integer},\mathrm{numeric},\mathrm{string}\right],\mathrm{rcurry}\left(\mathrm{convert},'\mathrm{truefalse}'\right)@\mathrm{subtype}\right)$
 $\left[{\mathrm{string}}{,}{\mathrm{posint}}{,}{\mathrm{integer}}{,}{\mathrm{numeric}}\right]$ (6)