XVal examples

Simple calculations

5 + 2   // Result: 7
6 - 3   // Result: 3
12 * 4  // Result: 48

Comparisons

1 = 2   // Result: false
1 <> 2  // Result: true
4 > 5   // Result: false
4 <= 5  // Result: true

Sum a list of numbers

(s:0 -> x+s | x <- [1,2,3,4])    // Result: 10

Return a running sum of numbers

[s:0 -> x+s | x <- [1,2,3,4]]   // Result: [1,3,6,10]

Return a running sum of numbers larger than 1

[s:0 -> x+s | x <- [1,2,3,4], x > 1]   // Result: [2,5,9]

Pick the last element that matches a condition

Or returns the default state if none is found.

Pick elements that match a condition

Evaluate to return a value

Last updated

Was this helpful?