consume(__iterable);

Description

Evaluate every element in an iterable and return the number of consumed elements.

Example

use System;

var inputs  = [1,2,3,4,5,6,7,8,9,10];   // Not yet evaluated
var peeks   = peek<print>(inputs);      // Evaluation happens here: 1-10 is printed
var nums    = consume(peeks);           // Prints 10: the number of items consumed
System.print(nums); 

function print(num) {
    System.print(num);
}