DMD 1.019 and 2.003 releases

Walter Bright newshound1 at digitalmars.com
Tue Jul 24 11:10:16 PDT 2007


0ffh wrote:
> So we get:
> 
>   char +/- int  : okay
>   int  +/- char : okay
>   char  -  char : okay
>   char  +  char : baddie!
> 
> I Look at this this way: Nobody in his right mind is gonna
> try to put into the compiler, which kinds of calculation
> make "sense" and which don't; that would be just insane.

But I do things like:

	c += 'a' - 'A';   // to lower case

The problem with explicit casts is that they are a brute force method, 
and subvert static type checking. A well designed systems allows a 
balance between implicit casting and strong type checking so that 
explicit casts are rarely needed in properly written programs.



More information about the Digitalmars-d-announce mailing list