Nordlöw:

I personally think we need a completely new language feature in D with which to compile-time-introspect function call arguments to check whether they adhere to certain requirements or matches for example the range of other given types.

I think "enum preconditions" are exactly that :-) But I don't know if they are good enough, if they are a good idea, of if there are better ways to do similar things. But I think something like that is an useful improvement for D, able to remove another limitation of user defined types compared to built-ins.

Bye,
bearophile

Reply via email to