Rebuilds a list by applying a function over it. For example, to copy a list, one would write:
foldr(pair, #(), #(1, 2, 3, 4, 5)) ⇒ #(1, 2, 3, 4, 5)
Exercise: what is the result when you replace pair with list?
| 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>. |
| result | An instance of <list>. |