The Right Approach to Exceptions

Andrei Alexandrescu SeeWebsiteForEmail at
Sat Feb 25 12:18:01 PST 2012

On 2/25/12 7:19 AM, Timon Gehr wrote:
> On 02/24/2012 08:14 PM, Andrei Alexandrescu wrote:
>> On 2/24/12 1:13 PM, H. S. Teoh wrote:
>>> In my mind, contract code belongs in the function signature, because
>>> they document how the function expects to be called, and what it
>>> guarantees in return. It doesn't seem to make sense to me that contracts
>>> would be hidden from the user of the library. Sorta defeats the purpose,
>>> since how is the user supposed to know what the function expects? Rely
>>> on documentation, perhaps, but docs aren't as reliable as actual
>>> contract code.
>> Yah, and that's why we managed, with great implementation effort, to
>> allow contract checks in interfaces. The concept has still to take off
>> though.
>> Andrei
> 'In' contracts are hardly usable at all at the moment, because they are
> not inherited by default.

I thought that was fixed. Is there a bug report on it? Thanks!


More information about the Digitalmars-d mailing list