<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 10, 2011, at 4:47 PM, James Gregurich wrote:</div><blockquote type="cite"><div>I'm coming to the engineers working on a brand new C++ compiler before they have implemented much of this stuff and I'm saying....think this problem out NOW and make it nice BEFORE you have a legacy code base to worry about....integrate it and make it work well so that we can have a nice, standards-based system. <br><br>I really don't understand why that is a statement that inspires objection. It seems to me that clean, tight, well-designed integration between Apple technology and standards-based technology should be a goal. I am encouraged by the fact that one of the Apple engineers is thinking about this concept and would like to try to make it work. I will be filing a feature request on ADC to officially log my desire for clean, automatic integration of lambdas with with Blocks-based APIs.<br></div></blockquote></div><div><br></div><div>In general, requests for features that involve Apple APIs and technologies should go through Apple's support channels (ADC). This list concerns the open-source Clang project, where Apple is but one of many concerned institutions.</div><div><br></div><div>With respect to lambdas and blocks, I too would like to see some level of interoperability. As John mentioned, an implicit conversion from a lambda object to a block pointer seems completely reasonable, and would allow one to seamlessly [*] use C++0x lambdas as arguments to APIs that take block pointers. Blocks can already be used with many APIs that accept C++0x lambdas, since a block behaves like a C++ function object so long as one handles the block copy/release externally. I doubt we'll see any low-level compatibility between the two features, e.g., C++0x lambda objects aren't likely to ever have the same layout as blocks, since C++ programmers won't want that memory cost for simple lambdas.</div><div><br></div><div><br></div><div>That said, nobody has actually looked into the implementation of lambdas in Clang, and I haven't seen any indication that it is coming soon. There's not much more we can do until that happens.</div><br><div><span class="Apple-tab-span" style="white-space:pre">    </span>- Doug</div><div><br></div><div><div>[*] Subject to sensible capture semantics, which is complicated by the fact that blocks and C++0x lambdas capture referenced variables in very different ways. This is something that needs to be carefully designed offline.</div><div><br></div></div></body></html>