Generic memory allocation in D
Adam Wilson
flyboynw at gmail.com
Tue Mar 5 09:57:36 UTC 2024
On Tuesday, 5 March 2024 at 09:33:35 UTC, Dom DiSc wrote:
> On Tuesday, 5 March 2024 at 03:26:22 UTC, Walter Bright wrote:
>> Don't think I haven't struggled with this question.
>>
>> Consider also that the convention for system calls is 0 is
>> success and anything else is an error.
>
> I know, and it is odd enough. But here it is boolean. "Anything
> else" is just one value: true. And "true" should never be the
> error value.
> Use any other type, and say 1 means "error code 1" instead of
> "true" and then it's ok.
> 0 is a neutral value, false is not. This is also one major
> reason to not automatically convert from int to bool or vice
> versa. Because then false becomes 0 which changes the meaning
> heavily.
I have an idea, since you all have such boundless energy for
nitpicking the most arcane of trivial minutia, could some of you
all direct this clear abundance of energy to JMD's Range Redesign
thread here:
https://forum.dlang.org/thread/mailman.1075.1709587824.3719.digitalmars-d@puremagic.com
Or maybe any of the Discussions here?
https://github.com/LightBender/PhobosV3-Design/discussions
We're gearing up to redesigns ranges as we start pulling things
into Phobos V3 and we could use some of this energy over there.
More information about the Digitalmars-d
mailing list