foldr in reverse. This function rebuilds a list by recursively applying a function over the list. For example
foldl(method(x, y) pair(factorial(x), y) end, #f, #(1, 2, 3, 4, 5))
⇒ #(120, 24, 6, 2, 1 . #f)
Note: the ugly dotted pair at the end is what occurs when nil is not #().
Exported from
Arguments
| cons | An instance of <function>. The signature of the function is (<list>, <list>) => (<pair>). |
| nil | An instance of <object>. Value returned if the list is empty. In most cases this should be #(). |
| lst | An instance of <list>. |
Values