enforce()?

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed Jun 16 00:44:25 PDT 2010


On Wed, 16 Jun 2010 00:18:03 -0700, Andrei Alexandrescu wrote:

> Bernard Helyer wrote:
>>> You need to read TDPL for that :o).
>> 
>> Please don't start replying to queries in this fashion. Not everyone
>> has the wherewithal to get a copy of a book such as TDPL. Especially
>> seeing as you're the author, this kind of reply just looks like whoring
>> for the book. I'm not saying that's what it is, just what it can look
>> like.
>> 
>> I've got TDPL on the way from Amazon, by the way. I just don't want to
>> see this reply, and wanted to express my distaste.
> 
> All right, all right.
> 
> Basically there's a marked difference between contract checking (which
> verifies the architectural integrity of a program) and error handling
> (which deals with errors that occur in correct programs). Contracts help
> with the former, enforce helps with the latter.

I think any confusion regarding this may stem from the fact that enforce
() resides in std.contracts.

Personally, I think it's worth moving it to object.d, but maybe it's too 
late for that?  Anyway, I love enforce() -- it's become my standard error 
handling tool.

-Lars


More information about the Digitalmars-d mailing list