--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
> (1) Should the elementAt method be moved to List?
>
> (2) All other methods in Iterable do not have element in their names (e.g., single and not singleElement). Why not simply at for elementAt?
It should really be operator []. List already has that, and if Iterable is supposed to have it too, there's really very little sense in giving it an extra name.
LT
I have a question concerning the length property in Iterable. It is final.List implements Iterable and there is a set method for the length property.I do not understand why the final property can be set?
> I have a question concerning the length property in Iterable. It is final.
>
> List implements Iterable and there is a set method for the length property.
>
> I do not understand why the final property can be set?
If an interface prescribes a final variable, it in fact prescribes a getter. Implementation of that interface is free to add a setter on top.
LT
> Iterable does not have operators.
There's no difference between methods and operators.
The real reason, I presume, is that not all Iterables can be indexed in O(1), but I'm not buying that.
LT
As I understand it (and please someone correct me if I'm wrong).
The real reason, I presume, is that not all Iterables can be indexed in O(1), but I'm not buying that.
My guess is it's either:The real reason, I presume, is that not all Iterables can be indexed in O(1), but I'm not buying that.1. Like you suggest they want [] to imply O(1) and Iterable can't ensure that.2. They didn't think to move this up to Iterable when the other stuff was reorganized.File and bug so we can find out?
Does the following from the elementAt doc applies to the corresponding operator?
Note: if does not have a deterministic iteration order then the function may simply return any element without any iteration if there are at least index elements in .
On Thursday, May 23, 2013 12:09:02 PM UTC-4, Bob Nystrom wrote:
On Thu, May 23, 2013 at 7:22 AM, Ladislav Thon <lad...@gmail.com> wrote:
The real reason, I presume, is that not all Iterables can be indexed in O(1), but I'm not buying that.
My guess is it's either:1. Like you suggest they want [] to imply O(1) and Iterable can't ensure that.2. They didn't think to move this up to Iterable when the other stuff was reorganized.File and bug so we can find out?- bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new