News for hackers. Stuff that matters.
Re:The error model of Microsoft's new language by edmccard on Monday December 30, 2013 @02:41PM (#6986401)
>Is the D scope + unrecoverable error different from Go's "defer" and "panic"?

D's scope guard is similar to "defer", but it has three forms: "scope(exit)", "scope(failure)", and "scope(success)". So instead of a deferred function that tests "if r := recover(); r != nil {...}" you just do "scope(failure) {...}"

D's unrecoverable error is just a matter of having an exception hierarchy where "Exception" and "Error" are separate subclasses of "Throwable", and by convention you prefer not to write "catch (Throwable t)" or "catch (Error e)".

There are no comments on this comment yet.