[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 Jonathan M Davischanged: What|Removed |Added CC||issues.dl...@jmdavisprog.co ||m --- Comment #12 from Jonathan M Davis --- (In reply to greenify from comment #10) > > All of these useless options left to sloppy range implementations don't > > bring value. > > This has probably been proposed before, but what about letting the compiler > insert an opDollar alias if length is defined? This should greatly help to > avoid sloppy implementation differences and one can still opt to use the > opDollar overloads for superior performance. https://issues.dlang.org/show_bug.cgi?id=7177 covers fixing it so that ranges that define length automatically get opDollar, but it's never gone anywhere. There has been discussion on it from time to time, but without implementing it, requiring ranges to work with $ is going to break a lot of code, since odds are that very few folks are implementing opDollar. Phobos itself doesn't do it consistently. But it's pretty ridiculous that we can't use $ with anything but arrays (which is basically where we sit now), and it really should be fixed. I did fix it some time ago so that isRandomAccessRange and hasSlicing verify that $ works correctly if it works (at least verifies it as much as can be done statically), but they've never required that $ works, because so few ranges implement opDollar, and issue #7177 has never been implemented. I'd have changed isRandomAccessRange and hasSlicing to require that $ work years ago if it weren't for that. --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #11 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/06c9dca2daf3edfde85ba01a9d22d842621fad1c [Issue 16073] Fix incorrect uses of random access range primitives in std.range.package https://github.com/dlang/phobos/commit/86ef3a224ed05bfe52b63caedc53ebdcf5be513e Merge pull request #4463 from JackStouffer/issue16073 --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 greenifychanged: What|Removed |Added CC||greeen...@gmail.com --- Comment #10 from greenify --- > All of these useless options left to sloppy range implementations don't bring > value. This has probably been proposed before, but what about letting the compiler insert an opDollar alias if length is defined? This should greatly help to avoid sloppy implementation differences and one can still opt to use the opDollar overloads for superior performance. --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #9 from Andrei Alexandrescu--- We can leave hasLength as is for the time but at least new algorithms should just use $. All of these useless options left to sloppy range implementations don't bring value. --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #8 from Jack Stouffer--- (In reply to Andrei Alexandrescu from comment #7) > I think we should require opDollar to be implemented instead. That would be a breaking change, as suddenly hasLength would fail for lots of user types. --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 Andrei Alexandrescuchanged: What|Removed |Added CC||and...@erdani.com --- Comment #7 from Andrei Alexandrescu --- I think we should require opDollar to be implemented instead. --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/06c9dca2daf3edfde85ba01a9d22d842621fad1c [Issue 16073] Fix incorrect uses of random access range primitives in std.range.package https://github.com/dlang/phobos/commit/86ef3a224ed05bfe52b63caedc53ebdcf5be513e Merge pull request #4463 from JackStouffer/issue16073 Partial Fix for Issue 16073 (part 3) --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a818c7e059bf0e37609c7030b8306daf54909beb [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.iteration https://github.com/dlang/phobos/commit/3a1db06f41eca48e1b1b46ca05bb221c01714160 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.mutation https://github.com/dlang/phobos/commit/74398e70cf79acab6a352e7bbec614ce2f91dffb [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.searching https://github.com/dlang/phobos/commit/e216c10b2ce08cb8ae5c64983a2f24367f4b86e4 Merge pull request #4383 from JackStouffer/issue16073 https://github.com/dlang/phobos/commit/94d74ac8f5772e3e32f7c2e2b4b59fd0783a6ad5 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.sorting https://github.com/dlang/phobos/commit/c5bb43ce54d7feb244ba032c43aecd7aa7c9356a Merge pull request #4425 from JackStouffer/issue16073 --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/94d74ac8f5772e3e32f7c2e2b4b59fd0783a6ad5 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.sorting https://github.com/dlang/phobos/commit/c5bb43ce54d7feb244ba032c43aecd7aa7c9356a Merge pull request #4425 from JackStouffer/issue16073 Partial Fix for Issue 16073 (part 2) --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a818c7e059bf0e37609c7030b8306daf54909beb [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.iteration https://github.com/dlang/phobos/commit/3a1db06f41eca48e1b1b46ca05bb221c01714160 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.mutation https://github.com/dlang/phobos/commit/74398e70cf79acab6a352e7bbec614ce2f91dffb [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.searching https://github.com/dlang/phobos/commit/e216c10b2ce08cb8ae5c64983a2f24367f4b86e4 Merge pull request #4383 from JackStouffer/issue16073 Partial Fix for Issue 16073 --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 --- Comment #2 from Jack Stouffer--- https://github.com/dlang/phobos/pull/4383 --
[Issue 16073] Ranges without opDollar not supported
https://issues.dlang.org/show_bug.cgi?id=16073 Jack Stoufferchanged: What|Removed |Added CC||j...@jackstouffer.com --- Comment #1 from Jack Stouffer --- I'd imagine this is an issue throughout Phobos. All functions that use isRandomAccessRange need to be checked as well. --