[OT] Converting booleans to numbers

Jonathan M Davis newsgroup.d at jmdavisprog.com
Wed Sep 20 23:57:22 UTC 2017


On Wednesday, September 20, 2017 21:13:58 nkm1 via Digitalmars-d-learn 
wrote:
> OTOH, booleans being numbers is a source of some bugs (just like
> other cases of weak typing). Not a ton of bugs, but the utility
> of implicit conversion to numbers is so unnoticeable that I'm
> sure it's just not worth it.

I think that most of us would agree with you, but the last time it was
serious discussed, Walter couldn't be convinced. Based on more recent
discussions with him, he did seem to now agree that we're probably too
liberal with how many implicit conversions we allow, but I don't know which
ones specifically he'd be willing to do differently if we didn't care about
breaking code. But since breaking code would definitely be a problem with
any implicit conversion that was removed, I doubt that it would be easy to
talk him into making any changes to the implicit conversions now even if you
could get him to agree that we ideally would.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list