Since this is a comment in response to an expressed desire to use macros, I'm curious -- is there some way you could use tagged template literals as a macro system? Beyond what eval gives you?
They can't directly substitute for macros because they run when execution reaches them, rather than once at load time, and because they can't inspect their code arguments.
Since this is a comment in response to an expressed desire to use macros, I'm curious -- is there some way you could use tagged template literals as a macro system? Beyond what eval gives you?
They can't directly substitute for macros because they run when execution reaches them, rather than once at load time, and because they can't inspect their code arguments.
But they do satisfy a lot of the desire for syntactic abstraction -- see e.g. https://github.com/erights/quasiParserGenerator