In python,
a = 3
eval(“a”) equals 3
Any Julia method similar to “eval()”? Thanks.
In python,
a = 3
eval(“a”) equals 3
Any Julia method similar to “eval()”? Thanks.
The closest correspondence is
eval(Meta.parse("a"))
but this is a case where the literal translation from Python is almost never the right thing to do in Julia.
What is the right approach depends on what you want to accomplish on a higher level.
See also: Metaprogramming · The Julia Language