No we should not support enum types derived from strings

deadalnix deadalnix at gmail.com
Wed May 12 11:45:52 UTC 2021


On Wednesday, 12 May 2021 at 02:41:31 UTC, 12345swordy wrote:
> On Wednesday, 12 May 2021 at 02:30:50 UTC, deadalnix wrote:
>> On Wednesday, 12 May 2021 at 02:21:06 UTC, 12345swordy wrote:
>>> Yes. A is being replace with the new instance of A that 
>>> happens to have the same value here. There is no guarantee 
>>> that they will share the same address.
>>>
>>> - Alex
>>
>> You might want to reconsider how sure of yourself you are.
> The code you posted, do not support your claim what so ever. 
> When I am talk about address I am literally talking about 
> virtual memory address here, such as 0x40000 or something 
> similar to that. You do not know what the actual virtual memory 
> address of variable of 'a' for class 'b', as the GC takes it 
> care of it for you.
> So when A is being replace with the new instance of A that 
> happens to have the same value that is being replace, the 
> virtual memory that A holds from the function parameter 
> currently holds will change.
>
> -Alex

Before posting that email was the best time to run the code, look 
at the output and deduce what it means.

The second best time is now.

In any case, I will disengage from that subthread with you, 
because it has reached its conclusion, and the point has been 
demonstrably made with actual code.

Arguing about what the code does really is pointless when you can 
simply run it and look at the result.


More information about the Digitalmars-d mailing list