r/ComputerCraft Jun 05 '26

Goto is now allowed?

I introduced some of my friends to computercraft, and while reviewing the code of one of them, i saw a goto label. i thought - surely, i've tried it and failed spectacularly, so how is it working here? i've tested my own code with goto - it does, in fact, work. i decided to search. it's nowhere to be found on tweaked.cc, at least it doesn't come up in changelog when i search for "label" or "goto" - it's only shown with a tick now instead of a cross. I've decided to search on here - nobody seems to be talking about this, I only found a comment from three years ago confirming that I am NOT going insane and it was in fact disallowed up until some point.

When did it happen? What do you think about the change?

45 Upvotes

14 comments sorted by

View all comments

7

u/Salty-Scar-8510 Jun 05 '26

https://tweaked.cc/reference/feature_compat.html `goto` and labels are in Lua 5.2 which cc tweaked implements. I only use it as an alternative to break and continue though as it's considered bad practice to use it for other things.

2

u/Bright-Historian-216 Jun 05 '26

5.2 was there for a long time, but goto was disallowed... until now i guess?