f::fold (public)
f::fold f e xs
Defined in packages/acs-tcl/tcl/ad-functional-procs.tcl
Takes a binary function f, a start element e and a list {x1 x2 ...} and returns f (...(f (f (f e x1) x2) x3)...). Examples: f::fold + 0 [list 1 2 3 4] = 10 f::fold * 1 [list 1 2 3 4] = 24
- Parameters:
- f (required)
- e (required)
- xs (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- functional_api
Source code: set result $e foreach x $xs { set result [$f $result $x] } return $resultXQL Not present: Generic, PostgreSQL, Oracle