-
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 ngeoffray@google.com 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 ngeoffray@google.com. |
This comment was originally written by alexey.v.varlamov...@gmail.com 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 alexey.v.var...@gmail.com 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 drfibonacci@google.com Added Triaged label. |
This comment was originally written by ngeoffray@google.com Handing off to Josh. Set owner to jjb@google.com. |
This is probably stale. Please re-open if you feel differently. Removed the owner. |
This issue was originally filed by alexey.v.var...@gmail.com
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: