float init 0 request

Walter Bright newshound2 at digitalmars.com
Thu Aug 20 00:01:10 UTC 2026


On 8/19/2026 2:25 PM, H. S. Teoh wrote:
> 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.

Since you don't like the casing example, consider string-to-decimal and 
decimal-to-string conversions.

P.S. I suspect the "simplistic" English is the result of 1) the explosive use of 
the printing press and 2) morse code and 3) the RADIX50 character set. These 
were all powerful pressures to simplify the written characters.


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

Function overloading is way overused, and yes, you can get into trouble with 
integral promotions and not covering the cases properly.


>> 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.

You may be using a modern Pascal. I was using an early Pascal that implemented 
Wirth's "Pascal User Manual and Report". I know that Borland's Turbo Pascal had 
to add in lots of extensions to make it even possible to write a program in 
Pascal. For example, the original Pascal had to be all in one file.

But there was one gem in Pascal - nested functions. And D has them!



More information about the Digitalmars-d mailing list