BigInt bool assign

Jonathan M Davis jmdavisProg at gmx.com
Fri Dec 23 16:51:02 PST 2011


On Saturday, December 24, 2011 01:08:11 Timon Gehr wrote:
> bool and int are in no way 'entirely different concepts'. Both are
> fields. bool is (Z_2, ^, &) , int is (Z_(2^32), +, *). string is
> conceptually a monoid.
> 
> Boolean algebra is the algebra of two values. At least in computer
> science or digital design, those two values are 0 and 1. If there are
> implicit conversions in a language at all, implicit bool -> int is a
> natural thing to do. There is no such argument for string -> int.

Boolean has the values are true and false. The fact that it's implemented as 1 
and 0 is an implementation detail. Conceptually, a bool is _not_ a number any 
more than a string is. As such, it shouldn't implicitly convert to a number 
any more than a string does.

- Jonathan M Davis


More information about the Digitalmars-d mailing list