enforce()?

Danny Wilson danny at decube.net
Mon Jun 28 12:17:05 PDT 2010


Op Mon, 28 Jun 2010 10:33:24 +0200 schreef Norbert Nemec  
<Norbert at nemec-online.de>:

> Conceptually, the ultimate solution would certainly be to place code for  
> input contract checking in the *calling* code. After all, this checking  
> code serves to debug the calling code, so it should be left to the  
> caller to decide whether checking is necessary.
>
I like this idea.

> This approach would also allow the compiler to optimize out some checks  
> when their correctness can be tested at compile time.
>
> Output contract checks, on the other hand should be compiled inside the  
> returning routine.
>
> After all, it is all a matter of trust. A language designer should trust  
> the language user to know what he is doing. A library designer should  
> trust the library user to act responsibly. After all - if the  
> application breaks it is the application designer who has to answer for  
> it.



Alot. :-)


More information about the Digitalmars-d mailing list