Previous Page Next Page Contents

Type::ListOf -- type for testing lists of objects with the same type

Introduction

Type::ListOf describes lists of objects of a specified type.

Call(s)

testtype(obj, Type::ListOf(obj_type <, min_nr <, max_nr>>))

Parameters

obj - any MuPAD object
obj_type - the type of the objects; a type can be an object of the library Type or one of the possible return values of domtype and type
min_nr - the minimal number of objects as nonnegative integer
max_nr - the maximal number of objects as nonnegative integer

Returns

see testtype

Related Functions

DOM_LIST, testtype, Type::ListProduct, Type::SetOf, Type::Union

Details

Example 1

Is the given list a list of identifiers?

>> testtype([a, b, c, d, e, f], Type::ListOf(DOM_IDENT))
                                   TRUE

Is the given list a list of at least five real numbers?

>> testtype([0, 0.5, 1, 1.5, 2, 2.5, 3], Type::ListOf(Type::Real, 5))
                                   TRUE

Example 2

testtype is used to select lists with exactly two identifiers:

>> S := {[a], [a, b], [d, 1], [0, d], [e], [d, e]}:
   select(S, testtype, Type::ListOf(DOM_IDENT, 2, 2))
                             {[a, b], [d, e]}

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000