type/nonemptylist - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/nonemptyset

type/nonemptylist

check for a nonempty list

type/nonemptyset

check for a nonempty set

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(expr, nonemptylist)

type(expr, nonemptyset)

type(expr, nonemptylist(K))

type(expr, nonemptyset(K))

Parameters

expr

-

any expression

K

-

type name

Description

• 

In the first two calling sequences, the type command checks if expr is a valid nonempty Maple list or set. It returns true if expr is a list or set containing at least one element and false otherwise.

• 

See the list and set help pages for a description of the list and set datatypes.

• 

In the third and fourth calling sequences, where K is a specified type name, the type command checks whether expr is a nonempty list or set whose entries are of type K.  That is, type(expr, nonemptylist(K)) returns true if type(expr, nonemptylist) is true and type(x, K) is true for each entry x of expr. Sets are checked in a similar manner.

• 

See the type help page for a description of valid types in Maple.

Examples

S1,32,2

S1,2,32

(1)

typeS,nonemptyset

true

(2)

typeS,nonemptysetrational

true

(3)

typeS,nonemptysetinteger

false

(4)

Lx41,x2,x+3

Lx41,x2,x+3

(5)

typeL,nonemptylist

true

(6)

typeL,nonemptylistpolynominteger,x

true

(7)

type,nonemptylist

false

(8)

type,nonemptyset

false

(9)

See Also

list

set

type

type/list

type/set