Brad Roberts:

> Restating in the form of a question... When would you _ever_ want {...}
> to not form a scope?

Recently I have shown a possible syntax for express general unsafeties in D 
code, for example:

unsafe (bounds, overflow) {
  ... // here there's no array bound checks, not integral overflow checks
}

I think this safe(...){...} and unsafe(...){...} don't need to form a scope, 
like static if.

--------------------------

Bill Baxter:

>I do think it would be nice if there was some kind of alternate non-scope 
>block delimiter syntax in D. When you have static ifs mixed with regular ifs 
>and versions it starts to be pretty difficult to see the flow of things. 
>Something like
static if (x) ::
     some stuff
::<

Probably I don't understand that syntax. A more full example may help me 
understand it. But if I understand it correctly, then I don't like that syntax. 
The {} add a little of noise, but help you know for sure inside where you are 
(the alternative, if the indenting level are low enough is of course the Python 
stile). Your style (if I understand it correctly) reminds me the way you use in 
Pascal to define compiler directives in blocks of code, and it leads to 
troubles compared to the static if {} of D.

Bye,
bearophile

Reply via email to