This repository was archived by the owner on Feb 19, 2018. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork4
This repository was archived by the owner on Feb 19, 2018. It is now read-only.
CS2 Discussion: Features: Tagged template literals #28
Closed
Labels
Description
Current Coffeescript is incompatible withtemplate literals, specificallytagged template literals. As such, direct support for template literals should be considered for coffeescript nextgen.
Specifically, calling a tagged template literal looks this:
var a = 5;var b = 10;function tag(strings, ...values) { ... return "Bazinga!";}tag`Hello ${ a + b } world ${ a * b }`;
Coffeescript already uses backticks toembed javascript:
hi = `function() { return [document.title, "Hello JavaScript"].join(": ");}`
Unless I've missed a trick, it's currently impossible to use a tagged template literal in Coffeescript by embedding the relevant ES6 javascript.
FYI, I ran into this problem when exploring the newishbel DOM templating library. Since it uses tagged template strings, I believe it's inoperable with current Coffeescript. This is the first time I've seen incompatibility between Coffeescript and Javascript..