How to know already included modules in Julia 1.x

question
module
#1

Hi. I’m trying to know already included modules in Julia 1.x.

For example,

include("path/to/moduleA.jl")
include("path/to/moduleB.jl")
# I want to know module A and B have already included here.

Does anyone know that?

0 Likes

#2

Perhaps something like

function available_modules(; mod = Main)
    filter(names(mod; all = true, imported = true)) do m
        getproperty(mod, m) isa Module && m ≢ mod
    end
end
2 Likes

#3

Oh, cool. Thank you so much!!

0 Likes