Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#20715" |
9fd288b to
f9e7c96
Compare
f9e7c96 to
00db26d
Compare
|
Spec PR dlang/dlang.org#4163 |
|
Note, these are accepted at global, but rejected at a scope level. Where does this sit with other kinds of statements that have ScopeStatement bodies, which don't get the same syntactical sugar treatment? |
|
A fair question. It only came up in the n.g. as a convenience wish for |
|
I have also been longing for allowing similar syntax for pragma(inline):
pragma(inline, false):
pragma(inline, true):. Is this possible to add support for? |
pragma(ident): // influence subsequent declarations
declaration;
declaration;https://dlang.org/spec/pragma.html That already works. |
Ahh. I forgot. Sorry for disturbing. Thanks. |
|
commit message should be updated so that #17700 will close |
|
This is the kind of change that @deadalnix will complain about because it will break tooling and force them to implement this new syntax. The question is, is it worth it ? Personally I don't think so. Using |
|
Personally love this, I've often reached out for |
|
Syntax-wise, void main()
{
with (x):
statement;
}and void main()
{
with x;
statement;
}It would work similar to C#’s
If we’re at it, with Object o = new Exception;
auto str = toString(); // auto str = o.toString()Requiring |
|
|
That is true for declaration scope only. It is expressly not true for statement scope in D and across languages. |
This was requested in the newsgroups. Adds the syntax:
which is equivalent to: