how to delay interpolation of template strings?

2014-12-16 Thread Niloy Mondal
I want to define a template string using backquotes in a different file and then have it interpolated with actual values in a different file. How can I do it? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: how to delay interpolation of template strings?

2014-12-16 Thread Niloy Mondal
Thanks, this would work. How can I construct a template string dynamically? Like reading the template from a file/database and then interpolate it. On Tue, Dec 16, 2014 at 2:29 PM, Claude Pache claude.pa...@gmail.com wrote: Le 16 déc. 2014 à 09:27, Niloy Mondal niloy.monda...@gmail.com

Re: how to delay interpolation of template strings?

2014-12-16 Thread Niloy Mondal
in order to interpolate its result ... OR you just go for this method which also works down to ES3 engine: https://gist.github.com/WebReflection/8f227532143e63649804 Regards On Tue, Dec 16, 2014 at 10:01 AM, Niloy Mondal niloy.monda...@gmail.com wrote: Thanks, this would work. How can

Re: Single destructuring argument to an arrow function

2015-03-20 Thread Niloy Mondal
Really awesome if we could have this feature. On Sat, Mar 21, 2015 at 4:04 AM, Brendan Eich bren...@mozilla.org wrote: But we could extend the cover grammar with some work. You'd have to push ArrayLiteral and ObjectLiteral down from PrimaryExpression alternative right-hand sides, to live

this value inside anonymous generator

2015-03-31 Thread Niloy Mondal
I wrote some code like the following in tracuer ``` class Foo { constructor() { spawn(function*() { let data = yield this.fetchData(); // error because 'this' is undefined }); } fetchData() { // returns promise } } ``` I used the spawn function from here:

Curried functions

2015-10-15 Thread Niloy Mondal
It would be really cool to have syntax to curry functions built into the languages. Something like... ```js curry function add(a, b) { return a + b; } add(2)(3); // 5 ``` ___ es-discuss mailing list es-discuss@mozilla.org

Return value of forEach

2015-10-16 Thread Niloy Mondal
Currently, `Array.prototype.forEach` returns `undefined`. It would be more useful if it returns the array itself. Say I have written some code like this... ```js const a = [1, 2, 3] .map(square) .map(plus1) .reduce(add); ``` For some reason, I am not getting the expected output. For

Re: Return value of forEach

2015-10-16 Thread Niloy Mondal
gt; example would be a more general ::-able. > > > On Fri, Oct 16, 2015 at 5:32 AM, Andrea Giammarchi < > andrea.giammar...@gmail.com> wrote: > >> ```js >> const a = [1, 2, 3] >> .map(square) >> .map(x => console.log(x) || x ) >> .map(plus1) >&

Re: Exponentiation operator precedence

2015-08-27 Thread Niloy Mondal
x ** y ** z is easier to read/write than x.pow(y.pow(z)) On Aug 27, 2015 8:51 AM, Mark S. Miller erig...@google.com wrote: On Wed, Aug 26, 2015 at 6:19 PM, Waldemar Horwat walde...@google.com wrote: On 08/26/2015 15:08, Mark S. Miller wrote: The force of that precedent is indeed what my