Template strings as a template language.

Mark S. Miller erights at google.com
Sun Sep 13 23:09:31 UTC 2015


On Sun, Sep 13, 2015 at 8:58 AM, Bob Myers <rtm at gol.com> wrote:

> Templating languages typically "compile" templates into functions through
> various lexical transformations.
>
> Consider a template file foo.tem:
>
> ```
> My name is ${this.name}.
> ```
>
> Lexically transform this into
>
> ```
> function foo() {
>   return `My name is ${this.name|}.`;
> }
>
> Then invoke the template as eg
>
> ```
> foo.call({name: 'Bob'})
> ```
>
> Having said that, I doubt if ES6 template strings serve as a useful basis
> for a full-fledged templating system. To take just one basic example, how
> would one implement the equivalent of `{{#if}}`?
>

What does `{{#if}}` mean?


>
> Bob
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150913/2d79a186/attachment.html>


More information about the es-discuss mailing list