let tmpl = addresses => html`
   <table>
   ${addresses.forEach(address=>
           html`<tr>${address.first}</tr><tr>${address.last}</tr>`
       ).join('\n')
   }
   </table>`


Yes. But you need to say ".map(" rather than ".forEach(" above. See
<http://wiki.ecmascript.org/doku.php?id=harmony:quasis#nesting>.

Oops, yes!

Thanks for pointing out how much fat arrows help for this use case. I
knew it would help but hadn't expected it to help that much. Nice!

Anything that helps to convince people that arrow functions are
not just an odd way of writing functions for people who don't
like to type;-)

Btw, the negative experience with Haskell's "monads" terminology
shows that choosing a scary name can hamper the adoption of even the most useful language features. So switching to "template strings" is a good idea. We do need to communicate that they are not limited to strings, though: template parameters and tag results can be
arbitrary ES objects/values.

Claus

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to