Bitcoin Forum

Other => Beginners & Help => Topic started by: t1mm3h on May 28, 2013, 02:05:01 PM



Title: Is recursion possible in scripting system
Post by: t1mm3h on May 28, 2013, 02:05:01 PM
A short question for which I didn't find an answer: is recursion possible in the scripting language that Bitcoin uses?


Title: Re: Is recursion possible in scripting system
Post by: Chrithu on May 28, 2013, 02:09:19 PM
Strange question.

As far as I'm aware most Bitcoin Clients are written in C++.

So yes recursion is possible in C++. Not sure if that will help you though.


Title: Re: Is recursion possible in scripting system
Post by: DannyHamilton on May 28, 2013, 02:09:40 PM
https://en.bitcoin.it/wiki/Script

Quote
Script is simple, stack-based, and processed from left to right. It is purposefully not Turing-complete, with no loops

With no loops and no user definable functions/subroutines, I can't think of a way to create a recursive action.


Title: Re: Is recursion possible in scripting system
Post by: niko on May 28, 2013, 02:11:41 PM
A short question for which I didn't find an answer: is recursion possible in the scripting language that Bitcoin uses?
Loops are not possible, if that is what you were wondering. If not, could you clarify by providing an example?

https://en.bitcoin.it/wiki/Script


Title: Re: Is recursion possible in scripting system
Post by: t1mm3h on May 28, 2013, 02:41:43 PM
https://en.bitcoin.it/wiki/Script

Quote
Script is simple, stack-based, and processed from left to right. It is purposefully not Turing-complete, with no loops

With no loops and no user definable functions/subroutines, I can't think of a way to create a recursive action.

Thanks. In that sense I can't think of it either.