Vocabulary
lists

Inputs
lista list
identityan object
quota quotation with stack effect ( ... prev elt -- ... next )


Outputs
resultthe final result


Word description
Combines successive elements of the list (in a right-associative order) using a binary operation, and outputs the final result.

Definition


:: foldr
( ... list identity quot: ( ... prev elt -- ... next ) -- ... result )
list nil?
[ identity ]
[ list cdr identity quot foldr list car quot call ] if ;
inline recursive