Replies: 2 comments 9 replies
-
I had considered this before, but there are technical hurdles that stop us from doing it that way. Essentially, there's no way to know at compile time if it's a Callable or not and to test that at runtime would incur in a performance hit for all calls (Callable or not). |
Beta Was this translation helpful? Give feedback.
-
I did consider this at the time when I rewriting the parser, but now I don't remember exactly why I didn't go with this. Do note that is not only properties, since you can have constants or local variables. It might be feasible if the compiler inserted the identifier's address to use its value as a fallback. But this also incur in some penalty to all (dynamic) calls, because even after a successful call there'll be a need to check if the call was indeed successful.
It would inevitably be slower, there's not really any way around it. Regarding static typing, I don't want to introduce syntax that is only available with static typing, so either it works for everything or it doesn't work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In GDScript 2.0 (Godot 4) you can write so
Can we write simply
f_call()
?Beta Was this translation helpful? Give feedback.
All reactions