Disallow side effects in assert

bearophile bearophileHUGS at lycos.com
Mon Feb 3 10:20:02 PST 2014


Daniel Murphy:

> Do you really want to force all codebases to 'pure'ify all 
> their functions?

What percentage of your functions are transitively called in your 
asserts? In my code it's a small percentage.


> A function call in an assert might be a red flag, but it 
> certainly isn't a bug.

I agree. I am suggesting to disallow just impure functions in 
asserts.

We have an acceptably good type system, but are we afraid of 
using it?

Bye,
bearophile


More information about the Digitalmars-d mailing list