On Tue, Oct 28, 2014 at 5:51 PM, Domenic Denicola <[email protected]> wrote:
> If I am understanding you correctly, I think what you want can be
> accomplished using the pattern
>
> ```js
> function templater(values) {
> return `hello ${values.person} it is a ${values.quality} day today`;
> }
>
> templater({ person: 'Antony', quality: 'reasonably good' });
> ```
>
>
Per Anthony's OP:
"My particular application is that I want to use a template system to
construct SQL queries in a modular way. For this particular application I
want programmatic control over when and how the expansion happens and won't
have the escaped template expressions in scope at the point where the
template string literal appears. "
Which cannot be solved in the way you've suggested, as the program won't
have any kind of static knowledge of the template form itself.
Rick
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss