The solution to "Error handling"...
Kapendev
alexandroskapretsos at gmail.com
Sun Jul 5 08:13:56 UTC 2026
On Sunday, 5 July 2026 at 07:53:15 UTC, Zz wrote:
> On Saturday, 4 July 2026 at 22:41:21 UTC, Jonathan M Davis
> wrote:
>> So, I'm not proposing that D does anything different with
>> floating point types, and if I were to create my own language,
>> I'd probably implement them the same way that they are in D,
>> because we really don't have a good alternative. But I
>> _really_ don't like them.
>>
>> - Jonathan M Davis
>
> Have you looked at this.
> https://zylinski.se/posts/a-programming-language-for-me/#zero-is-initialized-zii
>
> Zz
It's a good first option when making a new type.
Doesn't work for types like this:
```d
struct DrawOptions {
Vec2 origin = Vec2(0.0f);
Vec2 scale = Vec2(1.0f); // <-- 1
float rotation = 0.0f;
Rgba color = white; // <-- 2
Hook hook = Hook.topLeft;
Flip flip = Flip.none;
ubyte layer = 0;
}
```
More information about the Digitalmars-d
mailing list