Simulating I/O errors [was: assume, assert, enforce, @safe]

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 1 12:05:00 PDT 2014


On 8/1/2014 8:18 AM, Assaf Gordon via Digitalmars-d wrote:
> As Walter said, it's alarming how many programs fail to handle such cases
> (though D is pretty solid in that regard).

One of the very cool things about the ranges+algorithms style of programming is 
things like I/O don't get mixed up in code that operates on data.

It means that detecting I/O failures only have to be coded in a relatively 
concentrated and small handful of places rather than sprinkled throughout the code.

Couple this with the exception model of reporting errors, and we have a fairly 
robust system of not silently overlooking I/O failures.


More information about the Digitalmars-d mailing list