truefalseFAIL - Maple Help

convert/truefalseFAIL

convert an expression to a value of type `truefalseFAIL'

 Calling Sequence convert( expr, 'truefalseFAIL' )

Parameters

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

Description

 • convert( expr, 'truefalseFAIL' ) attempts to convert the expression expr to one of the values true, false, or FAIL. This is intended to be used in composition with procedures that return a boolean literal that can include the value FAIL.
 • 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.

Examples

 > $\mathrm{convert}\left(2<3,'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{convert}\left(3<2,'\mathrm{truefalseFAIL}'\right)$
 ${\mathrm{false}}$ (2)

The following conversion returns FAIL because complex numbers are not comparable with <.

 > $\mathrm{convert}\left(1
 ${\mathrm{FAIL}}$ (3)

The following conversion returns an error because the values of a and b are unknown.

 > $\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]$ (4)

Compatibility

 • The convert/truefalseFAIL command was introduced in Maple 2022.