DigiTechs wrote:
I was wondering if there was a way in BYOB to detect if a piece of code can run with no errors, as it would help a lot with what I'm trying to do. Is there a block that can help me with this?
No. This is equivalent to solving the Halting problem, as you could make a script have an error if a simulated turing machine halts.
I don't know much about BYOB, so please correct me.
Offline
Molybdenum wrote:
DigiTechs wrote:
I was wondering if there was a way in BYOB to detect if a piece of code can run with no errors, as it would help a lot with what I'm trying to do. Is there a block that can help me with this?
No. This is equivalent to solving the Halting problem, as you could make a script have an error if a simulated turing machine halts.
I don't know much about BYOB, so please correct me.
I was trying to make a block in BYOB that functions similarly to the pcall in Lua. It stands for 'Protected Call', so if the script inside of a pcall errors, the pcall catches it and returns a status code. It doesn't affect the code status outside of it though.
Offline
DigiTechs wrote:
Molybdenum wrote:
DigiTechs wrote:
I was wondering if there was a way in BYOB to detect if a piece of code can run with no errors, as it would help a lot with what I'm trying to do. Is there a block that can help me with this?
No. This is equivalent to solving the Halting problem, as you could make a script have an error if a simulated turing machine halts.
I don't know much about BYOB, so please correct me.I was trying to make a block in BYOB that functions similarly to the pcall in Lua. It stands for 'Protected Call', so if the script inside of a pcall errors, the pcall catches it and returns a status code. It doesn't affect the code status outside of it though.
You can implement catch/throw with call/cc.
Offline
nXIII wrote:
DigiTechs wrote:
Molybdenum wrote:
No. This is equivalent to solving the Halting problem, as you could make a script have an error if a simulated turing machine halts.
I don't know much about BYOB, so please correct me.I was trying to make a block in BYOB that functions similarly to the pcall in Lua. It stands for 'Protected Call', so if the script inside of a pcall errors, the pcall catches it and returns a status code. It doesn't affect the code status outside of it though.
You can implement catch/throw with call/cc.
cc? What BYOB block is that? Is it a custom one?
Offline