Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Issue 11363252: Extend Iterable instead of implementing it. (Closed)

Created:
8 years, 1 month ago by floitsch
Modified:
8 years ago
CC:
reviews_dartlang.org, Lasse Reichstein Nielsen, regis
Visibility:
Public.

Description

Extend Iterable instead of implementing it. This way all Iterables inherit the functions defined in Iterable. Make Iterable a const class. Add methods for the one Iterable that cannot extend. Committed: https://code.google.com/p/dart/source/detail?r=14962

Patch Set 1 #

Patch Set 2 : Fix bad copy/paste. #

Total comments: 10

Patch Set 3 : Address Stephen's comments. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -15 lines) Patch
M sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/dartstring.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/nodes.dart View 1 2 1 chunk +48 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/util/link.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/core/iterable.dart View 1 2 4 chunks +18 lines, -4 lines 0 comments Download
M sdk/lib/utf/utf16.dart View 1 chunk +1 line, -1 line 3 comments Download
M sdk/lib/utf/utf32.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/utf/utf8.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/utf/utf_core.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js_extra/for_in_test.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/apidoc/mdn/extract.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
8 years, 1 month ago (2012-11-15 00:49:52 UTC) #1
sra1
https://codereview.chromium.org/11363252/diff/1014/sdk/lib/_internal/compiler/implementation/tree/nodes.dart File sdk/lib/_internal/compiler/implementation/tree/nodes.dart (right): https://codereview.chromium.org/11363252/diff/1014/sdk/lib/_internal/compiler/implementation/tree/nodes.dart#newcode475 sdk/lib/_internal/compiler/implementation/tree/nodes.dart:475: List result = new List(); new List() -> [] ...
8 years, 1 month ago (2012-11-15 01:02:17 UTC) #2
floitsch
https://codereview.chromium.org/11363252/diff/1014/sdk/lib/_internal/compiler/implementation/tree/nodes.dart File sdk/lib/_internal/compiler/implementation/tree/nodes.dart (right): https://codereview.chromium.org/11363252/diff/1014/sdk/lib/_internal/compiler/implementation/tree/nodes.dart#newcode475 sdk/lib/_internal/compiler/implementation/tree/nodes.dart:475: List result = new List(); On 2012/11/15 01:02:18, sra1 ...
8 years, 1 month ago (2012-11-15 01:27:27 UTC) #3
Anders Johnsen
LGTM
8 years, 1 month ago (2012-11-15 10:31:14 UTC) #4
Ivan Posva
Here is a general comment about style and choosing implements over extends. -Ivan https://codereview.chromium.org/11363252/diff/2014/sdk/lib/utf/utf16.dart File ...
8 years ago (2012-11-26 18:13:01 UTC) #5
floitsch
Addressed Ivan's comments in https://codereview.chromium.org/11416240/ https://codereview.chromium.org/11363252/diff/2014/sdk/lib/utf/utf16.dart File sdk/lib/utf/utf16.dart (right): https://codereview.chromium.org/11363252/diff/2014/sdk/lib/utf/utf16.dart#newcode218 sdk/lib/utf/utf16.dart:218: class IterableUtf16Decoder extends Iterable<int> ...
8 years ago (2012-11-28 14:16:01 UTC) #6
Lasse Reichstein Nielsen
8 years ago (2012-11-28 21:29:35 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/11363252/diff/2014/sdk/lib/utf/utf16.dart
File sdk/lib/utf/utf16.dart (right):

https://codereview.chromium.org/11363252/diff/2014/sdk/lib/utf/utf16.dart#new...
sdk/lib/utf/utf16.dart:218: class IterableUtf16Decoder extends Iterable<int> {
Is there any way that this could be made cheaper?
E.g., when the class and its superclass always have the same type
parameterization, and since type parameters are final on the object, could it be
stored only once?

Powered by Google App Engine
This is Rietveld 408576698