hasindex
test for whether object is indexed by a given object
Calling Sequence
Parameters
Description
Examples
Compatibility
hasindex(A, ind)
A
-
indexable or module; expression to check
ind
(optional) expression sequence comprising index to be tested
The function hasindex determines if ind is a valid index for the structure A; that is, whether A contains a value corresponding to the key ind.
If A is a table, hasindex tests whether ind is a key in the table.
If A is a module or record, hasindex tests whether ind is an export of the module.
If A is an rtable, hasindex tests whether ind is consistent with the dimensions of A. Note that ind may have fewer dimensions than A.
If A is an list, set, or string, hasindex tests whether ind is a nonzero integer whose absolute value does not exceed the length of A.
L≔quick,brown,fox
hasindexL,2
true
hasindexL,4
false
M≔LinearAlgebra:-VandermondeMatrix1,2,3,5
M≔11111248139271525125
hasindexM,2,3
hasindexM,3,5
m ≔ module_exporteend module:
hasindexm,e
hasindexm,f
ds≔DataSeries32,25,42,labels=X,Y,Z
ds≔X32Y25Z42
hasindexds,X
The hasindex command was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
has
index
indexing_operator
member
Download Help Document