I'm glad throw is now an expression

WebFreak001 d.forum at webfreak.org
Tue May 17 08:36:02 UTC 2022


On Monday, 16 May 2022 at 17:03:08 UTC, max haughton wrote:
> On Monday, 16 May 2022 at 15:18:11 UTC, deadalnix wrote:
>> So, throw is now an exception. It is true that this is useful, 
>> for instance, it is now more convenient to throw from a lambda.
>>
>> [...]
>
> ThrowExpressions were implemented in libdparse weeks ago. No 
> idea if dfmt actually works with them or not but the idea this 
> was done with absolutely no concern for the ecosystem is unfair.

IMO these small syntax improvements are important to keep the 
language moving and alive. I didn't implement ThrowExpressions in 
libdparse, but I was happy to review it and we got it into 
libdparse promptly end of January.

D-Scanner has a tagged release and will evaluate code properly, 
DCD still needs a new tag but if you compiled from source you 
will already get a newer dsymbol version that supports it even on 
the same tag. dfmt's latest version also includes parsing 
support, but it only operates on tokens so nothing changes there 
really.

I think shortened methods and named arguments are also great 
small improvements like this.


More information about the Digitalmars-d mailing list