Type::TableOfEntry
-- type
for testing tables with specified entries
describes
tables with entries of type Type::TableOfEntry
(obj_type)obj_type
.
testtype(obj,
Type::TableOfEntry(obj_type)
)
obj |
- | any MuPAD object |
obj_type |
- | the type of the entries; can be an object of the
library Type or one of
the possible return values of domtype and type |
see testtype
testtype
, table
, Type::TableOfIndex
testtype(obj,
Type::TableOfEntry(obj_type)
) checks, whether
obj
is a table and all entries
of this table are of the type obj_type
. If both conditions
are met, the call returns TRUE
, otherwise FALSE
.obj_type
.The following table uses identifiers as keys and integers as entries:
>> T := table(a = 1, b = 2, c = 3, d = 4): testtype(T, Type::TableOfEntry(DOM_INT))
TRUE
Type::TableOfEntry
only checks the type of
the entries, not the keys:
>> T := table(a = 1, b = 2, c = 3, d = 4): testtype(T, Type::TableOfEntry(DOM_IDENT))
FALSE
>> delete T: