Type::TableOfEntry -- type
for testing tables with specified entries
Introduction describes
tables with entries of type Type::TableOfEntry(obj_type)obj_type.
Call(s)testtype(obj,
Type::TableOfEntry(obj_type))
Parametersobj |
- | 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 |
Returnssee testtype
Related
Functionstesttype, table, Type::TableOfIndex
Detailstesttype(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.
Example
1The 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: