Thread overview
[D-runtime] TypeInfo_Invariant -> …_Immutable?
Oct 02, 2013
David Nadlinger
Oct 02, 2013
Iain Buclaw
Oct 02, 2013
David Nadlinger
Oct 02, 2013
Jonathan M Davis
October 02, 2013
Hi all,

I'd like to change the name of TypeInfo_Invariant, the wrapper for adding a layer of 'immutable' to a type, to TypeInfo_Immutable, as it makes things clearer when working on the DMD/druntime internals – especially to newcomers, as invariant had its current meaning for ages now.

Am I missing a way this could actually break client code (on the API level, the ABI obviously changes, but we do that all the time)? TypeInfo_Invariant is in object, but not documented.

David
_______________________________________________
D-runtime mailing list
D-runtime@puremagic.com
http://lists.puremagic.com/mailman/listinfo/d-runtime

October 02, 2013
On Oct 2, 2013 3:03 PM, "David Nadlinger" <code@klickverbot.at> wrote:
>
> Hi all,
>
> I'd like to change the name of TypeInfo_Invariant, the wrapper for adding a layer of 'immutable' to a type, to TypeInfo_Immutable, as it makes things clearer when working on the DMD/druntime internals – especially to newcomers, as invariant had its current meaning for ages now.
>
> Am I missing a way this could actually break client code (on the API level, the ABI obviously changes, but we do that all the time)? TypeInfo_Invariant is in object, but not documented.
>
> David
>

There's probably someone somewhere that uses TypeInfo_Invariant in their
code (eg: std.format maybe?)

I'd probably keep an alias for typical deprecation / remove procedures.

Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


October 02, 2013
On Wed, Oct 2, 2013 at 4:14 PM, Iain Buclaw <ibuclaw@ubuntu.com> wrote:
> There's probably someone somewhere that uses TypeInfo_Invariant in their
> code (eg: std.format maybe?)

Oh dear, TypeInfo_Invariant is indeed used once in the the deprecated, undocumented part of std.format. And it directly checks for the occurrence of "Invariant" in the mangled name, something that would inevitably break if we renamed the class.

Still, I feel that oddities like this decrease the "hackability" of the D tool chain – maybe we should just stick a big red notice in the code comments?

David
_______________________________________________
D-runtime mailing list
D-runtime@puremagic.com
http://lists.puremagic.com/mailman/listinfo/d-runtime

October 02, 2013
On Wednesday, October 02, 2013 17:46:45 David Nadlinger wrote:
> On Wed, Oct 2, 2013 at 4:14 PM, Iain Buclaw <ibuclaw@ubuntu.com> wrote:
> > There's probably someone somewhere that uses TypeInfo_Invariant in their
> > code (eg: std.format maybe?)
> 
> Oh dear, TypeInfo_Invariant is indeed used once in the the deprecated, undocumented part of std.format. And it directly checks for the occurrence of "Invariant" in the mangled name, something that would inevitably break if we renamed the class.
> 
> Still, I feel that oddities like this decrease the "hackability" of the D tool chain – maybe we should just stick a big red notice in the code comments?

I don't see any problem with just renaming it, creating an alias to the old name, and deprecating the alias. It requires a change in std.format, but that can obviously be done. At that point, I don't see any problem with std.format (though maybe I'm missing something). What about the typical renaming and deprecation process wouldn't work? This isn't even a symbol that's likely used much in user code.

- Jonathan M Davis
_______________________________________________
D-runtime mailing list
D-runtime@puremagic.com
http://lists.puremagic.com/mailman/listinfo/d-runtime