I has had always been confusing on Julia Metaprograming. Here is an example:
I have a variable:
const SAer = 1
How can I define a macro like:
macro Ticker_str(x)
#do someting
end
to get this:
v=Ticker"SA"
# v === SAer
I has had always been confusing on Julia Metaprograming. Here is an example:
I have a variable:
const SAer = 1
How can I define a macro like:
macro Ticker_str(x)
#do someting
end
to get this:
v=Ticker"SA"
# v === SAer
julia> const SAer = 1
1
julia> macro Ticker_str(x)
return esc(Symbol(x, "er"))
end
@Ticker_str (macro with 1 method)
julia> v = Ticker"SA"
1
Thanks much for your help.