How to generate variables and assign values from a dictionary by metapgramming?

You probably want eval(:(const $(Symbol(key)) = $(parsed_args[key]))). (Note that I’m inserting the value of parsed_args[key] directly into the expression tree.) In general, it is vastly more flexible and reliable to build expression trees directly rather than parsing strings.

2 Likes