Template strings as a template language.
thomasjamesfoster at bigpond.com
Tue Sep 15 15:08:49 UTC 2015
> On 16 Sep 2015, at 12:39 AM, Claude Pache <claude.pache at gmail.com> wrote:
> That doesn't make much sense, because regexpes are first-class objects, while template literals are syntax.
> The nearest equivalent of the string-to-regexp feature is the string-to-code conversion facility provided by `eval` and `Function`.
> I have the impression that people want to use features provided by `eval`, `Function` or `with`, but without pronouncing these taboo words.
> Just use them if you need to: at least you will be clear about what you are really doing.
I would like to use a feature that today can only be achieved with `eval`, `with` or `Function`, but those three are hugely overpowered for the job (turning any old string into a template string). The 'taboo' about using eval, with and Function is justified, and it'd be nice to not have to rely upon them.
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss