-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
- Essentially, using a subTransform block and for each, one can achieve recursion. Below is an example of a factorial using recursion.
_$factorial :
n : derived.item
n1 : derived.n -1
isOne : derived.n == 1
item : derived.isOne ? derived.n : derived.n * ([derived.n1] | forEach({},derived._$func) | pluck(['item']))
output : [1,2,3,4,5,6] | forEach({},derived._$factorial) | pluck(['item'])A simple and short-term solution would be to add a check if anywhere in the code _$func is used. Then, in the UI, throw a warning that "If termination condition is not met, in recursion, the playground may get stuck. "
A long-term solution would involve adding a max run duration if and only if there is a recursion involved in the code.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers