-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clarify docs for Collection interface #495
Comments
This comment was originally written by [email protected] Hi Alexey, I'm not sure the Collection interface needs these 'clarifications'. For example, if the collection is empty, you may not use the parameter at all, and adding an explicit check for the parameter being a closure is kind of wasteful. A general statement that we should add to corelib is that passing in a wrong type will lead to undefined behavior. As for the order, a 'Collection' does not know about any order. I'd rather talk about ordering in the List interface. Set owner to [email protected]. |
This comment was originally written by [email protected] I agree that adding general statements somewhere would obviate the need to reiterate about things like ObjectNotClosureException. My guess is that "exceptions.dart" is the right candidate to place such general statements. I certainly would not mind if you override some docs in the List interface, where additional semantics appears for inherited methods. Still the following clarifications are desirable:
Thanks for the prompt response, btw! |
This comment was originally written by [email protected] One more thought about the general statement: it is clear that there can't be absolute answer to invalid usage of APIs, yet it would be more friendly to hint which reaction one would normally expect for typical error conditions. |
This comment was originally written by [email protected] Added Triaged label. |
This comment was originally written by [email protected] Handing off to Josh. Set owner to [email protected]. |
This is probably stale. Please re-open if you feel differently. Removed the owner. |
This issue was originally filed by [email protected]
The API documentation for corelib interface Collection (http://dart.googlecode.com/svn/trunk/dart/corelib/src/collection.dart) needs some clarifications.
The suggested patch fills in the gaps.
Attachment:
collection.patch (1.73 KB)
The text was updated successfully, but these errors were encountered: