You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that the EV3 offers support for subroutines, but I was wondering whether they are able to be recursive themselves and/or mutually recursive. I checked out some of the programs in the test data and the documentation, and I was not able to find any information that suggested that is or isn't possible. Could you please clarify this?
The text was updated successfully, but these errors were encountered:
It is not technically possible to do recursion with the current EV3 firmware. If a subcall is running and a second instance of the same subcall is called, it blocks until the first instance ends. So trying to call a subcall recursively results in a deadlock.
Is there a possible work-around for creating a subcall that acts in a recursive manner? That is, can we make a subcall call itself without using the call keyword directly or some kind of mutual recursion?
It might be possible to do "tail call" recursion where one subcall completes before the next is started.
Or maybe code could be devised to push and pop local variables and the program counter from a stack and use the jump instruction to restart a subcall without exiting it.
I understand that the EV3 offers support for subroutines, but I was wondering whether they are able to be recursive themselves and/or mutually recursive. I checked out some of the programs in the test data and the documentation, and I was not able to find any information that suggested that is or isn't possible. Could you please clarify this?
The text was updated successfully, but these errors were encountered: