Method code for $list.sum()

[Turn off line numbering]
  1: arg data;
  2: var ret, i;
  3: 
  4: // returns a sum of each element in the list.
  5: if (!data)
  6:     return 0;
  7: [ret, @data] = data;
  8: for i in (data)
  9:     ret += i;
 10: return ret;

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon