Adding a new design constraint to D

Salih Dincer salihdb at hotmail.com
Sat Jun 18 15:58:45 UTC 2022


On Saturday, 18 June 2022 at 15:01:16 UTC, Dennis wrote:
> On Saturday, 18 June 2022 at 09:42:40 UTC, Max Samukha wrote:
>> Yes, that's a good one. I still believe it wasn't worth the 
>> special case.
>
> What special case? Using `;` as an empty statement instead of 
> `{}` is not allowed anywhere in D as far as I can tell.

No conflicts...

**Scope Example:**
```d
void main()
{
   import std.stdio;
   {
     enum ver = 1;  // (!)
   }

   enum ver = 208;  // (!)
   double d = ver;

   while (d++ <= ver)
   {
     "Hello!".write(" D Compiler v");
   }

   {
     d /= 100;
     double subVer = 0.1; // (?)
     d.writeln(subVer);
   }

   double subVer = 0.9; // what?
   writeln(d + subVer); // next deneration D3
} /* Prints:
Hello! D Compiler v2.10.1
3
*/
```


More information about the Digitalmars-d mailing list