[Issue 15928] New: chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Apr 15 11:10:01 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15928

          Issue ID: 15928
           Summary: chain(r1, r2, r3, ...) should discard all arguments
                    after the first infinite range
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

Consider a call chain(r1, r2, r3, ..., rk, ..., rn) where range rk is infinite.
Then that should return the same exact result (type and behavior) as chain(r1,
r2, r3, ..., rk). This is because chaining effectively stops at the infinite
range and simply continues with it forever.

Obviously a good case is chain(r1, r2) which simply returns r1 if infinite.

An alternative would be to refuse compilation - this use may be a bug more
often than not. Thoughts?

--


More information about the Digitalmars-d-bugs mailing list