New paste Repaste Download
function _integral_rec(v, sum=0, i=0, arr=[]) = (i == len(v)) ? arr :
  let(
    nsum = sum + v[i]
  )
  _integral_rec(v, nsum, i+1, concat(arr, nsum));
integral = function (v) _integral_rec(v);
echo(integral([2,5,9,4,3,1,4]));
Filename: None. Size: 237b. View raw, , hex, or download this file.

This paste expires on 2024-12-29 20:11:15.344713. Pasted through web.