the indexing operator
`?`(x, l, m)
expression to be indexed
list of indices
list of values to assign
The indexing operator, `?`, provides a way to encode the process of indexing an expression in a function call.
The first calling sequence evaluates to the expression x, indexed by the entries of the list l. For example, `?`(tbl, [a, b]) evaluates to tbl[a, b].
Evaluating the second calling sequence assigns the expression sequence contained in the list m to the entry that the first calling sequence evaluates to. For example, evaluating `?`(tbl, [a, b], [c, d]) is the same as running the statement tbl[a, b] := c, d;.
The help page object,operators discusses some of the uses and consequences of overriding the indexing operator in an object. Briefly, it allows the object author to define the behavior when an object is indexed.
To obtain a table entry, you can index the table directly, or use the indexing operator.
To assign a table entry, you can use indexing syntax, or use the indexing operator.
You can use the indexing operator to obtain a list of entries in a table, using the map2 command.
The indexing operator works with all expressions that can be indexed, not just tables. The following map statement indexes a list, a Vector, and a variable with the number 2. This returns the second entries of the list and the Vector, and the unevaluated indexed variable.
Download Help Document
What kind of issue would you like to report? (Optional)