<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Le 25/06/2013 02:36, Dmitry Soshnikov a
      écrit :<br>
    </div>
    <blockquote
cite="mid:CAOKhmrHEbfQ90ovFzCsFbcWvG8zKumxoZRthRj=cp03G5sgYHA@mail.gmail.com"
      type="cite">
      <div dir="ltr">On Mon, Jun 24, 2013 at 5:00 PM, Mark S. Miller <span
          dir="ltr"><<a moz-do-not-send="true"
            href="mailto:erights@google.com" target="_blank">erights@google.com</a>></span>
        wrote:<br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="im">On Mon, Jun 24, 2013 at 4:46 PM, Axel
                  Rauschmayer <span dir="ltr"><<a
                      moz-do-not-send="true"
                      href="mailto:axel@rauschma.de" target="_blank">axel@rauschma.de</a>></span>
                  wrote:<br>
                </div>
                <div class="gmail_extra">
                  <div class="gmail_quote">
                    <div class="im">
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div style="word-wrap:break-word">
                          <div>Sorry for bringing this point up, again.
                            It is a minor point, but details matter if
                            ECMAScript 6 is supposed to feel consistent.</div>
                          <div><br>
                          </div>
                          <div>In general, I like how ECMAScript 6 has
                            evolved functions. Before, functions played
                            three roles:</div>
                          <div><br>
                          </div>
                          <div>1. Constructor</div>
                          <div>2. Method</div>
                          <div>3. Non-method function (where you want
                            lexical `this`)</div>
                          <div><br>
                          </div>
                          <div>In ES6, we have classes for #1 and method
                            definitions for #2 (in both object literals
                            and class literals). Furthermore, arrow
                            functions replace function expressions and
                            have lexical `this`. What is missing is a
                            function declaration with lexical `this`.</div>
                          <div><br>
                          </div>
                          <div>What’s the best way to solve this and to
                            eliminate the pitfall of dynamic `this` (at
                            least for beginners)? Tell people to
                            const-bind arrow functions?</div>
                        </div>
                      </blockquote>
                      <div><br>
                      </div>
                    </div>
                    <div>
                      IMO, yes.</div>
                    <div class="im">
                      <div><br>
                      </div>
                      <div> </div>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div style="word-wrap:break-word">
                          <div> We’d lose hoisting, though.</div>
                        </div>
                      </blockquote>
                      <div><br>
                      </div>
                    </div>
                    <div>yes. I don't think this will actually be a
                      problem in practice.</div>
                    <div class="im">
                      <div><br>
                      </div>
                      <div> </div>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div style="word-wrap:break-word">
                          <div> I also wouldn’t want to lose the
                            symmetry function declaration/generator
                            declaration and method definition/generator
                            method definition.</div>
                        </div>
                      </blockquote>
                      <div><br>
                      </div>
                    </div>
                    <div>
                      I do sometimes wish there was a natural place to
                      put a "*" on an arrow function, and sometimes I
                      don't wish it. In any case, it's not gonna happen
                      in ES6.</div>
                    <div class="im">
                      <div> </div>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <div style="word-wrap:break-word">
                          <div><br>
                          </div>
                          <div>IMO, we need a consistent story for ES6
                            in this area.</div>
                        </div>
                      </blockquote>
                      <div><br>
                      </div>
                    </div>
                    <div>const foo = (a,b) => a+b;</div>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
        <div class="gmail_extra">For simple procedures-like function
          still<br>
          <br>
        </div>
        <div class="gmail_extra">function doAction() {<br>
            ...<br>
          }<br>
          <br>
        </div>
        <div class="gmail_extra">looks more familiar for programmers
          than<br>
          <br>
        </div>
        <div class="gmail_extra">const doAction = () => {}<br>
        </div>
      </div>
    </blockquote>
    You'd be surprised. I've read lots of files from different people
    where I was left wondering "why did he/she choose 'var x =
    function(){...}' over 'function x(){}'". In the end, there was no
    good reason.<br>
    <br>
    David<br>
  </body>
</html>