{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4925","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4925/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4925/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4925/events","html_url":"https://github.com/jashkenas/coffeescript/issues/4925","id":298203113,"number":4925,"title":"CS2 Discussion: Features: Tagged template literals","user":{"login":"coffeescriptbot","id":36576729,"avatar_url":"https://avatars1.githubusercontent.com/u/36576729?v=4","gravatar_id":"","url":"https://api.github.com/users/coffeescriptbot","html_url":"https://github.com/coffeescriptbot","followers_url":"https://api.github.com/users/coffeescriptbot/followers","following_url":"https://api.github.com/users/coffeescriptbot/following{/other_user}","gists_url":"https://api.github.com/users/coffeescriptbot/gists{/gist_id}","starred_url":"https://api.github.com/users/coffeescriptbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coffeescriptbot/subscriptions","organizations_url":"https://api.github.com/users/coffeescriptbot/orgs","repos_url":"https://api.github.com/users/coffeescriptbot/repos","events_url":"https://api.github.com/users/coffeescriptbot/events{/privacy}","received_events_url":"https://api.github.com/users/coffeescriptbot/received_events","type":"User","site_admin":false},"labels":[{"id":841194363,"url":"https://api.github.com/repos/jashkenas/coffeescript/labels/new%20feature","name":"new feature","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-02-19T09:10:00Z","updated_at":"2018-02-19T09:10:20Z","closed_at":"2018-02-19T09:10:00Z","author_association":"COLLABORATOR","body":"_From @greghuc on [2016-09-01 15:55](https://github.com/coffeescript6/discuss/issues/28)_\n\n\nCurrent Coffeescript is incompatible with [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals), specifically [tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals). As such, direct support for template literals should be considered for coffeescript nextgen.\n\nSpecifically, calling a tagged template literal looks this:\n\n```\nvar a = 5;\nvar b = 10;\n\nfunction tag(strings, ...values) {\n  ...\n  return \"Bazinga!\";\n}\n\ntag`Hello ${ a + b } world ${ a * b }`;\n```\n\nCoffeescript already uses backticks to [embed javascript](http://coffeescript.org/#embedded):\n\n```\nhi = `function() {\n  return [document.title, \"Hello JavaScript\"].join(\": \");\n}`\n```\n\nUnless I've missed a trick, it's currently impossible to use a tagged template literal in Coffeescript by embedding the relevant ES6 javascript.\n\nFYI, I ran into this problem when exploring the newish [bel](https://github.com/shama/bel) 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..\n"},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/366628076","html_url":"https://github.com/jashkenas/coffeescript/issues/4925#issuecomment-366628076","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4925","id":366628076,"user":{"login":"coffeescriptbot","id":36576729,"avatar_url":"https://avatars1.githubusercontent.com/u/36576729?v=4","gravatar_id":"","url":"https://api.github.com/users/coffeescriptbot","html_url":"https://github.com/coffeescriptbot","followers_url":"https://api.github.com/users/coffeescriptbot/followers","following_url":"https://api.github.com/users/coffeescriptbot/following{/other_user}","gists_url":"https://api.github.com/users/coffeescriptbot/gists{/gist_id}","starred_url":"https://api.github.com/users/coffeescriptbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coffeescriptbot/subscriptions","organizations_url":"https://api.github.com/users/coffeescriptbot/orgs","repos_url":"https://api.github.com/users/coffeescriptbot/repos","events_url":"https://api.github.com/users/coffeescriptbot/events{/privacy}","received_events_url":"https://api.github.com/users/coffeescriptbot/received_events","type":"User","site_admin":false},"created_at":"2018-02-19T09:10:20Z","updated_at":"2018-02-19T09:10:20Z","author_association":"COLLABORATOR","body":"_From @greghuc on [2016-09-12 06:53](https://github.com/coffeescript6/discuss/issues/28#issuecomment-246263203)_\n\n\n@GeoffreyBooth I think outputting tagged template literals in ESNext is actually the nicest option:\n- Far less work\n- Is semantically equivalent to ES6 tagged template literals, by definition\n\nI considered the polyfill approach, as I didn't think outputting ESNext would be an option. So I'd be happy aiming for ESNext output for first implementation.\n\nBut I'll start with the proposal first.\n"}}
{"actor":{"display_login":"coffeescriptbot"}}