Sum adds the successive input values.
Sum has one input and three outputs :
triggers the collection of a new value, and the addition of this value to a sum
returns the current value of the sum
The components of a list are returned successively by listloop to sum.
At each step of the loop, eachtime triggers and prints the sum of the components.
The state of sum at the end of the loop, that is, the sum of all the components of the list, is returned by finally.
We now want to calculate the sum of 10 random numbers between 1 and 10.
The number of loops is defined by forloop.
At each step :
After ten loops, the iteration is stopped by forloop.
Finally returns the sum of the whole set of numbers returned by om-random.