A calculus for dynamic linking