<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Coffeescript seems to have some radical behavior (a.b?.c.d.e.f) a
    bit similar to what I suggested (which ok can not be in js)<br>
    <br>
    But the discussion here still does not say how much a.b?() or
    a.b?.call(xxx) is used in coffeescript<br>
    <br>
    Personnaly I was thinking that ?. should more allow to check
    existence rather than both checking and calling it if it exists,
    difficult to win everywhere<br>
    <br>
    Le 19/06/2012 22:35, Allen Wirfs-Brock a écrit :
    <blockquote
      cite="mid:B8369E3D-0107-40F8-83E6-21B75F088F7C@wirfs-brock.com"
      type="cite"><br>
      <div>
        <div>On Jun 19, 2012, at 12:37 PM, Jeremy Ashkenas wrote:</div>
        <br class="Apple-interchange-newline">
        <blockquote type="cite">On Tue, Jun 19, 2012 at 3:33 PM, Allen
          Wirfs-Brock <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:allen@wirfs-brock.com" target="_blank">allen@wirfs-brock.com</a>></span>
          wrote:<br>
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div class="im"><br>
                >  foo.bar?(args) <==>  foo.bar?.call(foo,
                args)<br>
                >  fun?(args) <==>  fun?.call(undefined, args)<br>
                <br>
              </div>
              How are these equivalent? Won't  fun?.call evaluate to
              undefined if fun is undefined and
              undefined(undefined,args) will throw...<br>
              <font color="#888888"><br>
              </font></blockquote>
            <div><br>
            </div>
            <div> ... check out the compilation:</div>
            <div><br>
            </div>
            <div><a moz-do-not-send="true"
href="http://coffeescript.org/#try:fun?.call%28undefined,%20args%29%0A%0Awindow.method?.call%28window,%20args%29">http://coffeescript.org/#try:fun%3F.call(undefined%2C%20args)%0A%0Awindow.method%3F.call(window%2C%20args)</a></div>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>Ah, interesting...so this is actually close to what I was
          advocating for this particular case.  However, if I now
          understand correctly you are saying that</div>
        <div>     fun?.call()</div>
        <div>produces undefined if fun is null/undefined but will throw
          if fun is defined as:</div>
        <div>   fun = new Object;</div>
        <div>because it doesn't have have "call" property.</div>
        <div><br>
        </div>
        <div>Also, it isn't clear to me why the second example
          (window.method?.call(window, args))  is only guarding for null
          and not undefined.  Is it only because you guard for undefined
          on variable references and not on property references?</div>
        <div><br>
        </div>
        <div>Basically, I see what the code you generate is doing but
          the unlying semantics that yields that code is less obvious.</div>
        <div><br>
        </div>
        <blockquote type="cite">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>It doesn't eagerly evaluate to undefined ... the value
              of the *entire* expression is undefined if the chain is
              broken at the existential operator. That's much of the
              point of soaks:</div>
            <div><br>
            </div>
            <div>object.property?.i.can.keep.chaining.in.here.without.throwing.errors.if.property.is.undefined
               ;)</div>
          </div>
        </blockquote>
        <br>
      </div>
      <div>Ah, again.  I don't think Brendan's strawman will produce
        that result.  The ...?.i is going to get undefined when it does
        GetValue on the Reference produced for object.property.  Then
        undefined.can will throw in step 5 of 11.2.1 because the LHS is
        undefined.  Getting this behavior seems to requires modifying .
        as well as defining ?. </div>
      <div><br>
      </div>
      <div>Allen</div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
es-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:es-discuss@mozilla.org">es-discuss@mozilla.org</a>
<a class="moz-txt-link-freetext" href="https://mail.mozilla.org/listinfo/es-discuss">https://mail.mozilla.org/listinfo/es-discuss</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
jCore
Email :  <a class="moz-txt-link-abbreviated" href="mailto:avitte@jcore.fr">avitte@jcore.fr</a>
Web :    <a class="moz-txt-link-abbreviated" href="http://www.jcore.fr">www.jcore.fr</a>
Webble : <a class="moz-txt-link-abbreviated" href="http://www.webble.it">www.webble.it</a>
Extract Widget Mobile : <a class="moz-txt-link-abbreviated" href="http://www.extractwidget.com">www.extractwidget.com</a>
BlimpMe! : <a class="moz-txt-link-abbreviated" href="http://www.blimpme.com">www.blimpme.com</a></pre>
  </body>
</html>