- Because it can fail, e.g. if the package is not actually installed.
- Because all the code between
do ... end
is an anonymous function, and it is not possible to import modules in a function’s scope. So this is one of those rare cases where it makes sense to use@eval
inside a function, so that the instruction is executed in the outer scope.
4 Likes