OT (Was: Re: What's the proper way to use std.getopt?)
H. S. Teoh
hsteoh at quickfur.ath.cx
Mon Dec 11 23:38:44 UTC 2017
On Mon, Dec 11, 2017 at 11:35:53PM +0000, Seb via Digitalmars-d-learn wrote:
[...]
> D style would be to use sth. like this (instead of try/catch):
>
> ```
> scope(failure) {
> e.msg.writeln;
> 1.exit;
> }
> ```
Frankly, much as I love UFCS syntax, I think this is taking it a little
too far. Maybe I'm just old-fashioned, but I still find `exit(1)` much
more readable than `1.exit`. Ditto for the writeln.
scope(failure), OTOH, rawkz. :-P
T
--
Don't drink and derive. Alcohol and algebra don't mix.
More information about the Digitalmars-d-learn
mailing list