hasindex - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : hasindex

hasindex

test for whether object is indexed by a given object

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

hasindex(A, ind)

Parameters

A

-

indexable or module; expression to check

ind

-

(optional) expression sequence comprising index to be tested

Description

• 

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.

Examples

> 

L≔quick,brown,fox

L≔quick,brown,fox

(1)
> 

hasindex⁡L,2

true

(2)
> 

hasindex⁡L,4

false

(3)
> 

M≔LinearAlgebra:-VandermondeMatrix⁡1,2,3,5

M≔11111248139271525125

(4)
> 

hasindex⁡M,2,3

true

(5)
> 

hasindex⁡M,3,5

false

(6)
> 

m ≔ module_export⁡eend module:

> 

hasindex⁡m,e

true

(7)
> 

hasindex⁡m,f

false

(8)
> 

ds≔DataSeries⁡32,25,42,labels=X,Y,Z

ds≔X32Y25Z42

(9)
> 

hasindex⁡ds,X

true

(10)

Compatibility

• 

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