float init 0 request
H. S. Teoh
hsteoh at qfbox.info
Thu Aug 20 04:26:48 UTC 2026
On Wed, Aug 19, 2026 at 05:01:10PM -0700, Walter Bright via Digitalmars-d wrote:
> On 8/19/2026 2:25 PM, H. S. Teoh wrote:
[...]
> > 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 don't actually use any Pascal (I dislike it for pretty much the same
reasons as yours). My point is that current D integer promotion rules
make narrow ints a royal pain to work with. A pain on the level of
working with casts in Pascal.
For example:
```d
ubyte x;
x++; // OK
x += 1; // OK
x = x + 1; // NG (WAT?)
x = cast(ubyte)(x + 1); // Pascal-level of annoyance
```
And this is just a trivial example. When you have a complex expression
involving narrow ints, the level of annoyance quickly becomes
unbearable.
T
--
If anyone wants a copy of Orthopedics Today, I have back issues.
More information about the Digitalmars-d
mailing list