Closed CarloLucibello closed 2 years ago
I replied in the same thread. I'm not convinced that this is a needed feature so don't plan to implement it here.
I still think that
@require import SomePkg
would be a good fit for this pkg, providing an alternative to @lazy
that is useful in cases where @lazy
incurs in world-age issues due to the returned types.
With this addition, LazyModules.jl and Requires.jl would cover the full spectrum of possibilities.
I haven't seen this pattern used elsewhere, so how about you adopt the function version first in MLDatasets and see how that works?
The @lazy import
pattern is used in FileIO and ImageIO for quite a long time so I'm confident that this is useful. -- but I'm not very sure of the @require
pattern. -- I'm not confident that people will like the "to use this feature, do using Foo
before" experience, we need time to test it and see how people feel.
See https://discourse.julialang.org/t/ann-accouncing-lazymodules-jl-delay-the-heavy-dependency-loading-to-its-first-use/80890/4?u=carlolucibello for a description