# What's new in 4.0/Operator::@

(new to 4.0)

The 'position' of value x in an index i is the number between 1 and n (=Size(i)) for which Slice(i, n) = x. The position operator "@" returns the numeric position of elements in an index. The first element of an index is at position 1, the last element of an index is at position Size(i), etc.

You can use "@" in three ways:

@i → an array of integers from 1 to Size(i) indexed by i.
@[i = x] → the position of value x in index i -- or NULL if x is not an element of i
e[@i = n] -→ the nth Slice of expression e over index i.

## Examples

We'll use the following indexes for illustration:

 Index Car_type := ['VW', 'Honda', 'BMW']
Index Time := [0, 1, 2, 3, 4]
Index Years := Time + 2007

@CarType →
Car_Type ▶
'VW' 'Honda' 'BMW'
1 2 3
@[Car_type = 'Honda'] → 2
Car_type[@Car_type = 2] → 'Honda'
@Time →
Time ▶
0 1 2 3 4
1 2 3 4 5
@[Time = 2] → 3
Time[@Time = 3] → 2
(Time + 2007)[@Time = 3] → 2009

You can use the slice variation to re-index an array by another array having the same length but different elements. Suppose Revenue is indexed by Time, then this returns the same array indexed by Years:

Revenue[@Year = @Time]