[OT] Programming language WATs

Kapps Kapps at NotValidEmail.com
Fri Jan 20 20:28:33 PST 2012


This issue left me with a permanent avoidance of ref foreach after 
encountering it the first day I used D.

On 20/01/2012 10:25 PM, Andrej Mitrovic wrote:
> One of the first bugs I've filed (now 1.5+ years old):
>
> void main()
> {
>      float[] arr = [1.0, 2.5, 4.0];
>      foreach (ref double elem; arr) {
>          elem /= 2;
>      }
>      writeln(arr);  // still [1, 2.5, 4]
> }
>
> Issue 4510



More information about the Digitalmars-d mailing list