-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove circle/diamond String constants #21248
Conversation
They were introduced in godotengine#14704 but need more discussion IMO, they don't strike me as core features that would have to be registered in Variant directly. Moreover, they currently break the documentation XML as string constants end up encoded as e.g. `value=""..""`.
9ac4ac9
to
f0b914f
Compare
Also removed the NodePath built-in constants as they broke documentation too, as they were encoded as invalid XML: <constants>
<constant name="CURRENT" value=""."">
</constant>
<constant name="PARENT" value="".."">
</constant>
</constants> I also don't see much use case for them, so it seems fine to remove for now, and reintroduce only if proven consensual and not breaking documentation. |
While discussing this collection of constants I would like to know if people are happy with The names have two issues I see:
Edit: I'm not sure how strongly this needs to be considered but the first point becomes a problem when porting to c# where the instance properties should be PascalCase. Given that we have an ecosystem with more than one language I encourage not choosing names that differ only by case. |
@KellyThomas A better name would be EDIT: #21253 |
Another name clash occurs between the member function In GDScript this seems to resolve correctly but will cause issues in languages like c# where static and instance members can't share a common name. |
That |
I'll see with @reduz if we can rename it to |
GDScript will have this same restriction in the future, so it's really important to avoid these conflicts. Maybe even embed it in the bindings to generate a compilation error if it happens. |
See #21267 for the |
They were introduced in #14704 but need more discussion IMO, they don't strike me as core features that would have to be registered in Variant directly.
What was approved in #14704 was mostly the way the new built-in constants were implemented, but the actual list of constants was not thoroughly reviewed. I'm not against adding constants to String but those 4 seem quite arbitrary to me, and set a precedent for "please add a constant for <insert favourite Unicode emoji here>" feature requests.