// file: number.rex // author: Robert Keller // number numbers the elements of any list, starting with 0. The number // elements are returned as a pair [element, index] number(List) = number(List, 0); // number(L, N) numbers the elements of list L starting with N number([], N) => []; number([A | L], N) => [[A, N] | number(L, N+1)];