How to create a macro for creating a symbol in Julia -
I am trying to create one in Julia to create a symbol
so that S is equal to "x"
is : x
. It does not work:
Julia & gt; Macro S_St (P) Symbol (P) and Julia & gt; S'x 'error: s not defined Julia & gt; S "X" error: x Not defined
The reason is that you
< The pre- macro s_str (p) coat symbol ($ p) can end and
, which is easy to read or more complex, but equivalent.
macro s_str (p) esc (: (symbol ($ p)) end
Comments
Post a Comment