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

Clarify docs for Collection interface #495

Closed
DartBot opened this issue Nov 17, 2011 · 6 comments
Closed

Clarify docs for Collection interface #495

DartBot opened this issue Nov 17, 2011 · 6 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant

Comments

@DartBot
Copy link

DartBot commented Nov 17, 2011

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)

@DartBot
Copy link
Author

DartBot commented Nov 17, 2011

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].
Added Area-Library label.

@DartBot
Copy link
Author

DartBot commented Nov 17, 2011

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:

  1. behavior of filter/every/some when this collection is empty.
  2. behavior when argument function fails (throws exception), in forEach/filter/every/some (this was not in the patch).

Thanks for the prompt response, btw!

@DartBot
Copy link
Author

DartBot commented Nov 17, 2011

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.
Much like "normative" vs "commentary" text in the specification.
Anyway, this would be a natural way to document corelib exception classes, which remain bare so far.

@DartBot
Copy link
Author

DartBot commented Nov 17, 2011

This comment was originally written by [email protected]


Added Triaged label.

@DartBot
Copy link
Author

DartBot commented Mar 20, 2012

This comment was originally written by [email protected]


Handing off to Josh.


Set owner to [email protected].

@sethladd
Copy link
Contributor

This is probably stale. Please re-open if you feel differently.


Removed the owner.
Added AssumedStale label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

2 participants