In Python, locals()
gives a dictionary containing all local variables. Is there an equivalent in Julia?
julia> function foo()
x = 1
Base.@locals
end
foo (generic function with 1 method)
julia> foo()
Dict{Symbol, Any} with 1 entry:
:x => 1
Lilith Hafner has marked this topic as resolved.
Thank you!
Last updated: Nov 22 2024 at 04:41 UTC