Reputation: 23
I have defined several variables working in Julia.
Now I would like to list those variables which are dictionaries (and hence are of Dict
type)
How do I list all variables of a specific type within a Julia REPL session?
Upvotes: 1
Views: 180
Reputation: 42234
I assume that you want to get a list of all dictionaries defined in your Julia session.
Supposing you have
a=Dict()
and b=Dict()
you can find them with the following code:
julia> [f for f in names(Main) if getfield(Main,f) isa AbstractDict]
2-element Vector{Symbol}:
:a
:b
Upvotes: 3