Project Elvis

Ola Fosheim Grøstad ola.fosheim.grostad+dlang at gmail.com
Mon Oct 30 00:41:30 UTC 2017


On Monday, 30 October 2017 at 00:10:13 UTC, w0rp wrote:
> One man's valid value is another man's invalid value. You can't 
> test for a general concept of "invalid," as you need context. 
> You can test for "falsy" with no context.

No, associating the numeral "0" with "false" is forcing a 
particular interpretation of int as representing a count of 
something. That is not an inate quality of the integer 
programming language type as such. For instance, there is no 
reason for "0 fahrenheit" to be "false". Only if "0" represents 
the "empty set" would that interpretation make some sense.

Yes, you can obviously have a general concept of invalid in a 
strict typing system.



More information about the Digitalmars-d mailing list