www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15928] New: chain(r1, r2, r3, ...) should discard all


          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 puremagic.com
          Reporter: andrei 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?

Apr 15 2016