Why D is annoying =P
deadalnix
deadalnix at gmail.com
Fri Oct 26 10:46:16 PDT 2012
Le 25/10/2012 04:12, Jonathan M Davis a écrit :
> On Wednesday, October 24, 2012 13:31:14 Walter Bright wrote:
>> The default compare for structs is a bit compare of the contents.
>
> Which definitely seems inherently broken. Doing that only works if the struct
> only contains integral types, character types, or bool. Nothing else will
> compare properly that way. It really needs to work like arrays do (or are
> supposed to anyway) and compare each member according to == and only fallback
> to an outright bitwise compare when it knows that the results would be
> identical (i.e. because all of the members are integral types, character
> types, bool, or other structs which hold only integral types, character types,
> or bool - be it directly or in other structs that they hold). Bitwise comparison
> is the is operator's job, not ==.
>
> - Jonathan M Davis
That will broke code.
But That is the way to go IMO. D needs to evolve to make things more
consistent in general.
Still not doable without a proper versionning scheme.
More information about the Digitalmars-d
mailing list