Any reason template string with empty interpolation placeholder (`${}`) throws?

Mark S. Miller erights at
Thu Oct 22 23:05:29 UTC 2015

It is an unnecessary special case. The empty string is a valid statement
(aside from the semicolon) but not a valid expression. The syntax of what
appears between the curlies is expression.

Having it default to the empty string makes no sense. Why not 0, false,
null, or undefined? Remember that template strings can be used to make
arbitrary objects using any DSL that your tag knows how to parse. There's
nothing about template strings that is about strings in either the
substitution values or the result values.

If you want the equivalent of `${''}`, just say `${''}`.

On Thu, Oct 22, 2015 at 6:31 PM, Caitlin Potter <caitpotter88 at>

> Doesn't necessarily seem like a bad idea. I could be on board with that.
> > On Oct 22, 2015, at 6:18 PM, Mohsen Azimi <me at> wrote:
> >
> > Pardon my lack of use of proper terminology.
> >
> > This is kind of annoying working with large template strings. When I
> leave an interpolation placeholder(what's the right name?) empty it blows
> up all my code.
> >
> > Can it be forgiving like Ruby and CoffeScript and just replace it with
> empty string?
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at
> >
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list