Deep nesting vs early returns

Jacob Carlborg doob at me.com
Thu Oct 4 12:03:03 UTC 2018


On Tuesday, 2 October 2018 at 20:53:40

> Is it:
> For optional binding, Swift 2 has sugar for
> if let !( ){}
>
> Or am I missing the point of the guard statement?

The variable declared in the guard statement is available after 
the statement. It’s like an if statement without the then part, 
only an else.

—
/Jacob Carlborg




More information about the Digitalmars-d mailing list