-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Array concatenation not documented on Array API page #2452
Comments
It's documented here. I'm not sure it makes sense to document features of the language under the classref. The purpose of the API page is to document methods and properties that belong to the specific class. The "+" operator isn't a method of Array (although you could make the argument that it is). |
I would argue that any class that does anything with the + operator other than add numbers together is overloading the operator and the overload should be documented as part of the class. For example the + operator in C++ may be described in places like: https://www.geeksforgeeks.org/operators-c-c/ but QList's operator overload is listed in its class documentation: because it is peforming behavior, that is concatentation, that is different than the "standard" behavior of adding numbers together - but in cases like Array, + is doing something specific to the class. |
You make a convincing argument. :) My suggestion would be to add it under the "description" section in https://github.com/godotengine/godot/blob/master/doc/classes/Array.xml If you havent contributed before, check out http://docs.godotengine.org/en/latest/community/contributing/index.html specifically the section titled "Contribute to the class reference" |
This closes godotengine/godot-docs#2452. (cherry picked from commit 8d53562)
Array has no .join() or .concat() method and the correct way to join arrays in GDScript is using the + operator, but this is not mentioned on the Array API page
The text was updated successfully, but these errors were encountered: