No we should not support enum types derived from strings

12345swordy alexanderheistermann at gmail.com
Wed May 12 14:35:27 UTC 2021


On Wednesday, 12 May 2021 at 11:45:52 UTC, deadalnix wrote:
> 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.
Like I said before, it does not support your claims, whatsoever. 
I wrote plenty of c# code before, and the code you posted does 
not support your claims whatsoever.

Classes are reference types not value types, end of discussion. 
Go to the official C# github and argue against the designers of 
the language if you don't believe me.


> 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.
Replacing the item in the box with the different yet exact same 
item, doesn't mean that you didn't modify the box. Again, print 
the object memory address, and you will see what I am talking 
about.

-Alex





More information about the Digitalmars-d mailing list