Replies: 12 comments 3 replies
-
This isn't a proposal, you need to fill out the different details, also a really bad idea in general |
Beta Was this translation helpful? Give feedback.
-
Okay, one, bruh |
Beta Was this translation helpful? Give feedback.
-
GDScript does not have any advanced optimization or analysis yet but it still would make scope management a nightmare, but goto generally makes code much harder to read |
Beta Was this translation helpful? Give feedback.
-
there was a problem, i could solve easier then i did, now i will check my code... |
Beta Was this translation helpful? Give feedback.
-
for example up. sorry code didnt tab |
Beta Was this translation helpful? Give feedback.
-
C++ has the most liberal goto statement of any high level language, and the only other mainstream one I can find is C# and it doesn't allow it outside of the current scope, why should GDScript go against the flow? So since this is a feature proposal, how should goto handle various contexts? What goto should be permitted? How should error handling look? var a
first:
var b
if ...:
var c
second:
var d
goto second # Should this be allowed? How should it be treated? Etc. etc. |
Beta Was this translation helpful? Give feedback.
-
hm, i see its impossible for gdscript, because of the architecture.(but iam not sure) sorry for, but usually i speak russian |
Beta Was this translation helpful? Give feedback.
-
In JavaScript, this is possible (break from block, not my_label:
{
console.log("A");
if (true) {
break my_label;
}
console.log("B");
}
console.log("C");
// Prints:
// A
// C In GDScript it might look like this: :my_label
block: # I couldn't think of a better name.
print("A")
if true:
break my_label
print("B")
print("C") Break from nested loop: :outer
for i in 10:
:inner
for j in 10:
if true:
break outer |
Beta Was this translation helpful? Give feedback.
-
The break from loops, or nested breaks like |
Beta Was this translation helpful? Give feedback.
-
See #3780 :) |
Beta Was this translation helpful? Give feedback.
-
Please, don't make low quality posts like that. If you want to open a discussion, then open a discussion. A proposal must have more thought put into it than just replicating the same sentence 10 times. |
Beta Was this translation helpful? Give feedback.
-
It's been said by others, but |
Beta Was this translation helpful? Give feedback.
-
add "goto" like in c++ to gdscript
Beta Was this translation helpful? Give feedback.
All reactions