If I have two symbols:
sym1 = :Hello
sym2 = :World
what is the best way to combine these:
combine(sym1,sym2)
to generate the symbol :HelloWorld
?
(In practice I have a macro with some input symbols, and I want to generate new symbols/variables that are a version of these)
1 Like
(I know there is Symbol(String(:Hello)*String(:World))
, however, I am not sure if this is the “best” approach, it feels rather hacky)
Benny
March 11, 2025, 10:02am
3
Symbol(sym1, sym2)
, works for any number of arguments. It still goes through strings, there’s no way around that because symbols are just interned strings.
4 Likes
Got it, still way prettier. Thanks a lot!