DIP 1002 (TryElseExpression) added to the queue

pineapple via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 29 04:02:13 PDT 2016


On Thursday, 29 September 2016 at 10:51:01 UTC, Nick Treleaven 
wrote:
> Note that finally(bool) is more flexible than finally/else as 
> you can interleave code arbitrarily. __guard makes it clearer 
> something special is happening rather than just implicitly 
> extending `try` scope in the `else` clause. Also, 'else' is not 
> clear enough IMO.

While I think finally(bool) is a decent approach, the languages 
that currently integrate this concept into their error handling - 
Python and Ruby to my knowledge - all use `else`. Clarity is not 
a good argument, because those who are already proficient in 
languages other than D will expect the syntax to be consistent 
with other languages. It would be like some language using 
foolishly using `elsif instead of `else if`. (Dammit, Perl.)



More information about the Digitalmars-d mailing list