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

Online Help

All Products    Maple    MapleSim


convert/truefalse

convert an expression to a value of type `truefalse'

 

Calling Sequence

Parameters

Description

Examples

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 evalb⁡expr returns true, then the conversion also returns the value true. Otherwise, the conversion returns the value false.

Examples

> 

convert⁡true,truefalse

true

(1)
> 

convert⁡false,truefalse

false

(2)
> 

convert⁡FAIL,truefalse

false

(3)
> 

convert⁡2<3&comma;truefalse

true

(4)
> 

convert⁡a<b&comma;truefalse

Error, (in `convert/truefalse`) unable to convert a < b to type `truefalse'

> 

sort⁡posint&comma;integer&comma;numeric&comma;string&comma;subtype

string&comma;posint&comma;integer&comma;numeric

(5)
> 

sort⁡posint&comma;integer&comma;numeric&comma;string&comma;rcurry⁡convert&comma;truefalse∘subtype

string&comma;posint&comma;integer&comma;numeric

(6)

See Also

convert

evalb

sort

type/boolean

type/truefalse