August 15, 2012 [Issue 8555] New: Round Robin and Infinite Ranges | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8555 Summary: Round Robin and Infinite Ranges Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: daniel350@bigpond.com --- Comment #0 from Daniel Cousens <daniel350@bigpond.com> 2012-08-15 14:58:29 PDT --- http://dlang.org/phobos/std_range.html#roundRobin As would be expected, RoundRobin goes into an infinite loop if the range is infinite; perhaps !isInfinite!R would be suitable to test against the input ranges? This may benefit other exhausting range functions also. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
January 01, 2013 [Issue 8555] Round Robin and Infinite Ranges | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Cousens | http://d.puremagic.com/issues/show_bug.cgi?id=8555 Peter Alexander <peter.alexander.au@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |peter.alexander.au@gmail.co | |m --- Comment #1 from Peter Alexander <peter.alexander.au@gmail.com> 2013-01-01 14:12:27 PST --- It's not a good idea to constrain the function unnecessarily. For example, you might want to construct an infinite round robin, but then take a finite number of elements from the start. e.g. auto r = roundRobin(cycle([0, 1]), cycle([0, 1, 2])).take(10); This should work, even though cycle is infinite. There's nothing wrong with infinite ranges, as long as you don't try to iterate them in their entirety :-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation