Can somebody give me an example of using an "open interval for the upper limit of a range"?

Manfred Nowak svv1999 at hotmail.com
Wed Mar 12 18:07:04 UTC 2025


On Tuesday, 11 March 2025 at 16:56:28 UTC, WhatMeWorry wrote:
[...]
> To include the upper bound value, use a square bracket "]" at 
> the end of the range."

[...]
> foreach( i, e; a[0..3] )
>     write(i, ":", e);  // 0:11  1:22  2:3

That example negates the claim of that Citation already!

Although a square bracket follows the range "0..3", neither the 
index '3´ nor the value of 'a[3]´ are remarked---and are not 
written indeed.

-manfred




More information about the Digitalmars-d-learn mailing list