Type unions in D

Justin Johansson procode at adam-dott-com.au
Tue Sep 15 19:43:35 PDT 2009


Jeremie Pelletier Wrote:

> As for the max of an empty set, you can just return zero.

Well you could return -1, 99 or any arbitrary integer for that matter; just that it doesn't make sense to do that from a pure maths perspective.  Mathematicians have spent centuries trying to make number systems consistent.  The invention (or discovery**) of "i", the square-root of minus-one, was a major major break-through.  In similar vein, it's nice if the type systems we use for programming follow from a consistent set of axioms. ;-)

(**Is mathematics invention or discovery?)

<JJ/>




More information about the Digitalmars-d mailing list