fold ( ... obj branches -- ... value )


Vocabulary
bend

Inputs
objan object
branchesa sequence of type/quotation pairs, with an optional quotation at the end


Outputs
valueThe result of the fold


Word description
Unpacks the slots of a tuple, recursively calling fold on slots with a type matching the original object (Except for slots typed with object). Then calls the branch according to object type, to produce a value.

Definition