Can we just have struct inheritence already?
Timon Gehr
timon.gehr at gmx.ch
Fri Jun 14 01:32:29 UTC 2019
On 13.06.19 23:49, Walter Bright wrote:
> On 6/13/2019 1:25 PM, Timon Gehr wrote:
>> On 13.06.19 09:27, Walter Bright wrote:
>>> The spec's wrong, because it doesn't do that.
>>
>> Memory safety implies no undefined behavior. The only way the spec can
>> be wrong [1] is if you say that corrupting memory has defined behavior
>> in D, in which case the spec would be too weak, and not too strong
>> like you are implying. Otherwise, "memory safe" and "no undefined
>> behavior" are equivalent.
>
> I've already agreed that an uninitialized int should have an undefined
> value, not undefined behavior :-)
> ...
To me it looked like you first (02:37) agreed that the spec is fine, but
then later (09:27) asserted that the spec is wrong. This might just be a
case of Walter time travel though.
> The spec does indeed lack precision with these terms, and it's something
> well worth addressing.
>
>
>> [1] Assuming here that we accept that @safe successfully protects
>> against memory corruption, ignoring assumptions that need to be made
>> on @trusted functions.
>
> The spec should be clear that @trusted functions must present an @safe
> interface.
I was just covering my bases. :)
More information about the Digitalmars-d
mailing list