Skip to content

Add slice/slice-assignment operators. #8977

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

Closed
lrhn opened this issue Mar 7, 2013 · 2 comments
Closed

Add slice/slice-assignment operators. #8977

lrhn opened this issue Mar 7, 2013 · 2 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented Mar 7, 2013

A lot of library operations on strings and lists would be more easily expressed using a Python (etc.) like "slice operator".

 T operator [:]({int start, int end});
 void operator[:]=(var value, {int start, int end});

This would replace String.substring with [:], make it easy to add List.subList/replace List.getRange with [:], use [:]= to replace insertRange.

Both parameters are optional, and usually default to start = 0 and end = length of sequence if omitted.

@DartBot
Copy link

DartBot commented Mar 8, 2013

This comment was originally written by @seaneagan


this is a duplicate of issue #983

@floitschG
Copy link
Contributor

Thanks.


Added Duplicate label.
Marked as being merged into #983.

@lrhn lrhn added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Mar 8, 2013
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants