bigint implicit cast to bool breaks code

bearophile bearophileHUGS at lycos.com
Thu May 30 17:19:41 PDT 2013


Paul D. Anderson:

> It's like the old joke: "Doc, it hurts when I do this." Doctor: 
> "Don't do that!"

And it's a good advice because:
- The mammalian body is able to heal a surprisingly high number 
of problems by itself, given the right conditions and enough 
time. In such time avoiding to do "that" (like jumping on a knee 
that hurts) is a good advice, and it's often one of the 
conditions for the healing.
- Even if the body needs a bit of help from medicine, avoiding 
hurting a sore spot is often a good idea. Especially when there 
is no good cure available (like in many orthopaedic problems, 
that have surgery solutions that often cause more problems than 
the original problem).


> I need both constant and mutable BigInts.

Me too. In the last years I've put some bug reports on this in 
Bugzilla. Don is well aware that bigints are not const-corrected. 
It's a matter of working on them and fixing the problem, because 
maybe now D has all the tools to perform this fix/improvement.

In the meantime my advice is to not use const bigints.

Bye,
bearophile


More information about the Digitalmars-d mailing list