It's easy to write a macro that takes a static literal string and makes a variable out of it.
It's much harder (maybe impossible) to write a macro that takes in a variable that happens to be bound to a string value and to make a variable out of the value you happen to have stored in that variable. Another way to put it: macros don't exist inside of the world of values -- they only live in the world of syntax. Could you get a similar (and cleaner) effect by populating a Dict instead? -- John On Dec 17, 2014, at 5:37 AM, Zeta Convex <[email protected]> wrote: > I want to be able to write: > @makevar("life", 42) > which will expand to > life = 42 > How do I do this? > > Why do I want to do it? Because it would be cool to have a feature like in > Octave where I could load an HDF5 file, and it automatically sets the > variables from the file.
