Ascertaining!

Salih Dincer salihdb at hotmail.com
Sat Jul 9 10:12:00 UTC 2022


Hi All,

I didn't know compiling was bottom-up. This example proves that. 
Because in single-line expressions, it takes value from the 
right, firstly.

```d
void main()
{
     int n;         // true (n == 0)
     int i = 1;     // true (i == 1)
     int j = i = n; // all numbers are 0

     n =
     i =
     j =

     1;              // all numbers are 1

     // ascertaining: n = i = j = 1;

     assert(j);
     assert(i);
     assert(n);
}
```
SDB at 879


More information about the Digitalmars-d-learn mailing list