Template strings as a template language.
eorroe at gmail.com
Tue Sep 15 14:57:13 UTC 2015
This seems to be the same thing I posted before as [String.substitute()](
https://esdiscuss.org/topic/string-substitute) I guess I didn't explain
correctly, but ayy I'm glad you guys are discussing this.
On Tue, Sep 15, 2015 at 10:39 AM, Claude Pache <claude.pache at gmail.com>
> Le 15 sept. 2015 à 14:02, Herby Vojčík <herby at mailbox.sk> a écrit :
> Andrea Giammarchi wrote:
> Yet it doesn't play well with i18n since arguments passed to the IIFE
> would still come from the current local scope. RegExp would play nicer
> Oh, I meant it other way, my dense communication again produce a
> misunderstanding, I meant something like "well, one can make regexp as well
> using eval('/'+aString.replace(/\//g, '\\/')+'/') or so, but there still
> is new Regexp there. So, having string-to-regexp in language, maybe we can
> as well have string-to-template.
> 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.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss