Is there any reason why arithmetic operation on shorts and bytes return int?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Tue Dec 11 10:12:48 PST 2012


On Tue, 11 Dec 2012 09:47:33 -0800
Walter Bright <newshound2 at digitalmars.com> wrote:

> On 12/11/2012 5:24 AM, d coder wrote:
> > Would I be asking for too much if I ask DMD to provide a compiler
> > flag that makes it return bytes and shorts for operations on them?
> > So the deal would be, if you use this compiler flag, code behavior
> > would be different from that of C/C++.
> 
> Having compiler flags that fundamentally change the behavior of the
> language are a disaster from about every point of view.
> 

Yea, I'd hate to see D turn into PHP. That's one of the biggest
reasons I despise PHP - code can't rely on fucking *anything* in it to
ever work in any particular way. Pick any random line of PHP code,
and there's about 20 different things it might do, even on the exact
same version of PHP, all depending on a billion different configuration
settings. Any library written in PHP is *inherently* broken simply by
being one codebase intending to be "usable" on different servers.

Let's not entertain any thoughts of allowing D to venture down that
path.



More information about the Digitalmars-d mailing list