This seems like it should be simple, but it’s still tripping me up. I need to write a function that gives this result:
julia> f(:x) :(someArray[:x])
Interpolation gives me a “raw” x, and I’m having a surprisingly hard time making a Symbol of it.
On a side note, it seems like this kind of thing happens a lot in metaprogramming. Something that seems like it ought to be simple just… isn’t. Is this just me? Or metaprogramming in Julia? Or something about metaprogramming in general?
I’ve read that in general macros aren’t composable, but in this case there aren’t any macros involved. Do we need more (or better) tools or combinators for this stuff? Or maybe a way to build the right mental model?
Julia is already much easier than it would be to produce similar results in something like Python. So it feels like I’m making progress and getting quicker at it. It’s just a bit frustrating for simple things like this to be throwing me.