Load a dependency only when calling a method that needs it

You can put using in a function like this:

function load_dep()
    @eval using Dependency
end

But this works only if you call this function from global scope, if you call it inside another function, you will not get this dependency in the calling function due to world age.

1 Like