float init 0 request

H. S. Teoh hsteoh at qfbox.info
Wed Aug 19 21:25:47 UTC 2026


On Wed, Aug 19, 2026 at 12:57:57PM -0700, Walter Bright via Digitalmars-d wrote:
[...]
> I've also always disliked C's "char" type because it is how one gets a
> byte integer, having nothing to do with characters. D fixes that.
> 
> But integral promotions are still retained, because doing integer
> operations on char's is not that unusual (such as upper/lower case
> conversions).

And that is where things go wrong.  Upper/lowercasing via arithmetic
works only for simplistic languages like English.  Other languages
require much more sophisticated algorithms (yes, algorithms) to do it
correctly.  And if you're already doing that, having implicit casting or
explicit is no longer a deciding factor.

Rather, the incorrectness of having a char literal match an int function
over a wchar function becomes a source of bugs.


> All in all, D's semantic selections for integral types are better than
> anyone else's for type safety and convenience.

Convenience?  Better than Pascal?  Hardly.  As things stand, you have to
sprinkle casts everywhere in your D code anyway, if you happen to work
with narrow integers.  Not much better than Pascal.


T

-- 
"I'm running Windows '98." "Yes." "My computer isn't working now." "Yes, you already said that." -- User-Friendly


More information about the Digitalmars-d mailing list