Skip to content
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

Closed
youreperfect opened this issue May 13, 2019 · 3 comments · Fixed by godotengine/godot#36624
Closed

Array concatenation not documented on Array API page #2452

youreperfect opened this issue May 13, 2019 · 3 comments · Fixed by godotengine/godot#36624

Comments

@youreperfect
Copy link

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

@clayjohn
Copy link
Member

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).

@youreperfect
Copy link
Author

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:
https://doc.qt.io/qt-5/qlist.html#operator-2b

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.

@clayjohn
Copy link
Member

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants