title: can i use y-combinator to get object reference for this closure?
body: <p>this closure works:</p>
  
  <pre><code>var o = {
      foo: 5
  };
  
  o.handler = function(obj){
      return function() {
          alert(obj.foo);
      };
  }(o);
  
  o.handler(); //alert('5')
  </code></pre>
  
  <p>is it possible to define handler in-line, perhaps with something similar to a y-combinator operation?</p>
  
  <pre><code>var o = {
      foo: 5,
      handler: function(obj){
          return function() {
              alert(obj.foo);
          };
      }(o); //pointer to o? -----------------------------
  };
  </code></pre>
  
  <p>out of academic curiosity, I'm not trying to do this in production code</p>
  
  <p><a href="http://blog.jcoglan.com/2008/01/10/deriving-the-y-combinator/#" rel="nofollow">intro to the y-combinator</a></p>