D - Unsafe and doomed

ilya-stromberg ilya-stromberg-2009 at yandex.ru
Sat Jan 4 11:28:48 PST 2014


On Saturday, 4 January 2014 at 19:05:00 UTC, Walter Bright wrote:
> On 1/4/2014 1:18 AM, "Ola Fosheim Grøstad" 
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>> I don't disagree, but isn't that just a special case of type 
>> constraints? Why
>> limit it arbitrarily to null-values, limiting the range of 
>> values is useful for
>> ints and floats too. If you move the constraint check to the 
>> function caller you
>> can avoid testing when it isn't needed.
>
> Yes, the non-NULL thing is just one example of a useful 
> constraint one can put on types.

Yes, exactly. And we have contact programming for this rules, but 
DMD doesn't support any contact checks at the compile time. Do 
you have any plans to improve the situation? For example, we can 
add `static in` and `static out` contacts.


More information about the Digitalmars-d mailing list