| 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]));
|
| 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]));
|