Skip to content

Instantly share code, notes, and snippets.

View reallyasi9's full-sized avatar
🐗

Phil Killewald reallyasi9

🐗
  • Greater Ann Arbor Area, Michigan, USA
View GitHub Profile
@reallyasi9
reallyasi9 / list_all_things.jl
Created March 6, 2023 20:23
Julia: LIST ALL THE THINGS!
"""
list_all_things(module::Module, [type::Type]) -> Vector{Symbol}
List all the things of a given `type` in `module`. If `type` is not given, all things will be listed.
"""
function list_all_things(m::Module, T::Type)
return filter(s -> typeof(eval(s)) <: T, names(m))
end
list_all_things(m::Module) = names(m)