name resolution in module imports

Jon Perez jbperez808 at yahoo.com
Fri Oct 1 09:19:01 PDT 2010


In the Youtube tech talk by Andrei (
http://www.youtube.com/watch?v=RlVpPstLPEc ), the audience member raises a
point at @34:20 about how code that does not qualify a module in a function
call, and just relies on function signatures to know which module this belongs
to may break if a newer version of the modules it imports suddenly puts into
the namespace a new function with the same signature as another module.

Andrei argues that this is a deliberate trade-off.  I think this is fine in a
statically linked library context because the binaries you ship never break
anyway.  But what about in a dynamically linked library scenario?

game.exe links to module1.dll and module2.dll and calls drawcircle(int,int)
which is not defined in module2 right now, but what if module2.dll gets
updated in the future and suddenly introduces a drawcirlce(int,int) as well?
Now game.exe will throw a runtime error.



More information about the Digitalmars-d mailing list