[Issue 7896] Sequence slicing
https://issues.dlang.org/show_bug.cgi?id=7896 Andrei Alexandrescu changed: What|Removed |Added Version|unspecified |D2 --
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 Andrej Mitrovic changed: What|Removed |Added Status|NEW |RESOLVED CC||andrej.mitrov...@gmail.com Resolution||FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 --- Comment #6 from github-bugzi...@puremagic.com 2012-09-16 19:17:33 PDT --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d9e1a501ecba84426ddde161dce7408e719a1a8b Added std.range.Sequence slicing (Issue 7896) See http://d.puremagic.com/issues/show_bug.cgi?id=7896 for more information. https://github.com/D-Programming-Language/phobos/commit/1b645ba717aadf175b93ab344394284008ff5d7d Merge pull request #748 from RommelVR/master Added std.range.Sequence slicing (Issue 7896) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 --- Comment #5 from Daniel Cousens 2012-08-12 05:50:52 PDT --- Made a pull request for this: https://github.com/D-Programming-Language/phobos/pull/748 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 --- Comment #4 from Dmitry Olshansky 2012-04-13 04:37:09 PDT --- The syntax is supported. It's just up to implementer of a range if he can provide opSlice meaningfully. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #3 from bearophile_h...@eml.cc 2012-04-13 04:21:59 PDT --- (In reply to comment #2) > With range concept, slicing operator with boundaries has no meaning. I think the point of this enhancement request is to give a meaning to that syntax. So: someRange[x .. y] becomes syntax sugar for calling a function like: itertools.islice(someRange, x, y) of Python: http://docs.python.org/library/itertools.html#itertools.islice the idea of giving some more syntax support to D lazy ranges isn't that bad. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 --- Comment #2 from Kenji Hara 2012-04-13 02:46:20 PDT --- (In reply to comment #0) > Rather then simply building an array from scratch, perhaps it should be > possible to do the following: > > auto my_odds = sequence!("n * 2 + 1")()[0...100] > > Unless there is another way to do this. With range concept, slicing operator with boundaries has no meaning. You should use std.range.take and std.array.array like follows: auto my_odds = array(take(sequence!("n * 2 + 1")(), 100)); And if you use 2.059beta or later, you can use UFCS syntax: auto my_odds = sequence!("n * 2 + 1")().take(100).array(); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 7896] Sequence slicing
http://d.puremagic.com/issues/show_bug.cgi?id=7896 Dmitry Olshansky changed: What|Removed |Added CC||dmitry.o...@gmail.com --- Comment #1 from Dmitry Olshansky 2012-04-13 02:33:47 PDT --- Somehow take(sequence!("n * 2 + 1")(), 100) doesn't cut it or what? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---