Fold and FoldList (like in Mathematica) in Grasshopper?

It would be great if we could use Fold and FoldList functionality of Mathematica within Grasshopper.

Basically, the component would take a list {a,b,c,d,…} and is somehow “linked” to a certain component F, and returns {a, F(a,b), F(F(a,b),c), F(F(F(a,b),c),d),…}. This behavior is similar to mass addition, but now I want this to work with any cluster I define.

This functionality could be a safer alternative for recursive or iterative code. Does anyone make a component to do this, or would this be a proper feature request for Grasshopper?

Since the input of a component which does this consists of a list of values and a network, it does sound like it would need core functionality. It’s definitely an interesting idea, I’ll put it on the list for Grasshopper 2.0

Logged under RH-53688

1 Like