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
hasindex⁡L,2
true
hasindex⁡L,4
false
M≔LinearAlgebra:-VandermondeMatrix⁡1,2,3,5
M≔11111248139271525125
hasindex⁡M,2,3
hasindex⁡M,3,5
m ≔ module_export⁡eend module:
hasindex⁡m,e
hasindex⁡m,f
ds≔DataSeries⁡32,25,42,labels=X,Y,Z
ds≔X32Y25Z42
hasindex⁡ds,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