tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/5435-recursive-pentagonsNodeBox: Discussion 2015-08-15T06:46:18Ztag:support.nodebox.net,2012-11-01:Comment/364086832015-03-31T09:49:35Z2015-03-31T09:49:37ZRecursive Pentagons<div><p>Very nice!</p></div>Rorytag:support.nodebox.net,2012-11-01:Comment/364086832015-04-02T00:01:55Z2015-04-02T00:01:56ZRecursive Pentagons<div><p>You were able to create a network that performed the recursive
operation, and then copy the network node 4 times and combine their
outputs.</p>
<p>However, the original question was regarding recursion support.
Is there plans to create a node which you could attach the network
node and select 4 recursions in order to create the same
output?</p>
<p>This would be very handy.</p></div>Garrett Millirontag:support.nodebox.net,2012-11-01:Comment/364086832015-08-15T06:46:17Z2015-08-15T06:46:17ZRecursive Pentagons<div><p>Dear NodeBox staff,</p>
<p>Garrett makes a good point here. As far as I can tell, there is
no way to do true recursion with NodeBox nodes (aside from calling
Python procedures). True?</p>
<p>This seems like a strange omission. NodeBox claims to be a
functional language yet the premise of other functional languages
is that they use recursion in place of loops.</p>
<p>Have you guys ever thought about a way to allow recursive nodes?
It's not immediately clear to me how to do this within the NodeBox
paradigm, but there must be a way.</p>
<p>Maybe you could have a "Parent" node that could only be used
inside a subnetwork. The parent node would take the same inputs as
the subnetwork it resided in and, if activated, would execute that
subnetwork.</p>
<p>To make a recursive factorial subnetwork you would compare the
input to 0 and tie that boolean output to a rendered switch node.
If true (1) the switch would return a 1; if false (0) it would
return n * parent(n-1) - which you would construct out of multiply
node, a subtract node, and a parent node.</p>
<p>If that wouldn't work, perhaps you could come up some other way
of allowing recursion. I sure wish I had something like this for
the project I'm working on at the moment.</p>
<p>Any thouughts?</p>
<p>John</p></div>john