std library hooks

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Mon Apr 16 12:27:38 PDT 2012


"Artur Skawina" <art.08.09 at gmail.com> wrote in message 
news:mailman.1798.1334576115.4860.digitalmars-d at puremagic.com...
>
> You do realize this is exactly how it is supposed to work? You *want* the
> build to fail if the implementation you were overriding parts of has 
> changed.
> Then you can evaluate the situation and adjust your code if necessary.
> Having the build silently succeed, resulting in a random mix of "new" code 
> and
> overridden "old" code is not a good idea - the reason the symbols were 
> placed
> in the same section/object/unit is likely because they are *not* 
> independent.
>

Even in that case, there's still these problems:

1. If you forgot to override some symbols, and your program isn't 
referencing them, then build erroneously succeeds. So you think you're ok 
until some change later on makes the build go BOOM.

2. The diagnostic messages are completely unhelpful.

If druntime was *specifically designed* to have "intended overridable" 
groups in their own object files, then that could work. Although the 
compiler is much better suited for defining and using APIs than the linker, 
since the compiler has, and uses, all that extra semantic information.




More information about the Digitalmars-d mailing list