Type:
@: list x int -> object
Call syntax:
l@
i
l@
i:=
expr
Description:
The binary infix operator "@" realises
element access for lists. It binds stronger than any other
operator in SALIERI.
There are two different forms of usage for the operator "@": in the form l@ i it is synonymous with the expression getList(l,i); in the form l@ i:= expr, where l has to be the name of a list object, it is synonymous with the statement l := putList(l,i,expr).
Error conditions:
Specifying an incorrect position i (not within
1 ... length(l)) causes an error condition.
Example:
> l := LIST(1,2,3,4)
> l@2
Result= 2
> l@3 := 0
> l
Result= LIST(1,2,0,4)
> l@6
Error in command-line:
Wrong index
(occured while executing function "getList")
See also: list (Object Type), getList, putList, Operators and Expressions.