DMD 1.019 and 2.003 releases

0ffh spam at frankhirsch.net
Mon Jul 23 23:01:19 PDT 2007


James Dennett wrote:
> BCS wrote:
>> char c;
>> int v = (c - '0')
> Perfectly reasonable, as is character +/- integer, but
> character + character is nonsense, just as it makes sense
> to subtract two points yielding a vector, or add a vector
> to a point (yielding a point) but no sense to "add" two
> points in a mere affine space.

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.

Also, in C at least a char is just another kind of number
that just happens to be about the right size for an ASCII
value, at least that's the way I look at it... ;-)

Regards, Frank



More information about the Digitalmars-d-announce mailing list