CINXE.COM
Neal Gafter's blog: A Consensus Closures JSR Proposal
<!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> <head> <link href='https://www.blogger.com/static/v1/widgets/55013136-widget_css_bundle.css' rel='stylesheet' type='text/css'/> <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/> <meta content='blogger' name='generator'/> <link href='https://gafter.blogspot.com/favicon.ico' rel='icon' type='image/x-icon'/> <link href='http://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html' rel='canonical'/> <link rel="alternate" type="application/atom+xml" title="Neal Gafter's blog - Atom" href="https://gafter.blogspot.com/feeds/posts/default" /> <link rel="alternate" type="application/rss+xml" title="Neal Gafter's blog - RSS" href="https://gafter.blogspot.com/feeds/posts/default?alt=rss" /> <link rel="service.post" type="application/atom+xml" title="Neal Gafter's blog - Atom" href="https://www.blogger.com/feeds/7803021/posts/default" /> <!--Can't find substitution for tag [blog.ieCssRetrofitLinks]--> <meta content='http://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html' property='og:url'/> <meta content='A Consensus Closures JSR Proposal' property='og:title'/> <meta content='I had set aside work on the closures prototype for a couple of months to write a JSR proposal that represents a consensus among the folks th...' property='og:description'/> <title>Neal Gafter's blog: A Consensus Closures JSR Proposal</title> <style id='page-skin-1' type='text/css'><!-- /* ----------------------------------------------- Blogger Template Style Name: Stretch Denim Designer: Darren Delaye URL: www.DarrenDelaye.com Date: 11 Jul 2006 ----------------------------------------------- */ body { background: #619bb8; margin: 0; padding: 0px; font: x-small Verdana, Arial; text-align: center; color: #000000; font-size/* */:/**/small; font-size: /**/small; } a:link { color: #215670; } a:visited { color: #215670; } a img { border-width: 0; } #outer-wrapper { font: normal normal 100% Verdana, Arial, Sans-serif;; } /* Header ----------------------------------------------- */ #header-wrapper { margin:0; padding: 0; background-color: #619bb8; text-align: left; } #header { margin: 0 2%; background-color: #215670; color: #efefef; padding: 0; font: normal normal 210% Verdana, Arial, Sans-serif;; position: relative; } h1.title { padding-top: 38px; margin: 0 1% .1em; line-height: 1.2em; font-size: 100%; } h1.title a, h1.title a:visited { color: #efefef; text-decoration: none; } #header .description { display: block; margin: 0 1%; padding: 0 0 40px; line-height: 1.4em; font-size: 50%; } /* Content ----------------------------------------------- */ .clear { clear: both; } #content-wrapper { margin: 0 2%; padding: 0 0 15px; text-align: left; background-color: #efefef; border: 1px solid #cccccc; border-top: 0; } #main-wrapper { margin-left: 1%; width: 64%; float: left; background-color: #efefef; display: inline; /* fix for doubling margin in IE */ word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } #sidebar-wrapper { margin-right: 1%; width: 29%; float: right; background-color: #efefef; display: inline; /* fix for doubling margin in IE */ word-wrap: break-word; /* fix for long text breaking sidebar float in IE */ overflow: hidden; /* fix for long non-text content breaking IE sidebar float */ } /* Headings ----------------------------------------------- */ h2, h3 { margin: 0; } /* Posts ----------------------------------------------- */ .date-header { margin: 1.5em 0 0; font-weight: normal; color: #666666; font-size: 100%; } .post { margin: 0 0 1.5em; padding-bottom: 1.5em; } .post-title { margin: 0; padding: 0; font-size: 125%; font-weight: bold; line-height: 1.1em; } .post-title a, .post-title a:visited, .post-title strong { text-decoration: none; color: #000000; font-weight: bold; } .post div { margin: 0 0 .75em; line-height: 1.3em; } .post-footer { margin: -.25em 0 0; color: #000000; font-size: 87%; } .post-footer .span { margin-right: .3em; } .post img, table.tr-caption-container { padding: 4px; border: 1px solid #cccccc; } .tr-caption-container img { border: none; padding: 0; } .post blockquote { margin: 1em 20px; } .post blockquote p { margin: .75em 0; } /* Comments ----------------------------------------------- */ #comments h4 { margin: 1em 0; color: #666666; } #comments h4 strong { font-size: 110%; } #comments-block { margin: 1em 0 1.5em; line-height: 1.3em; } #comments-block dt { margin: .5em 0; } #comments-block dd { margin: .25em 0 0; } #comments-block dd.comment-footer { margin: -.25em 0 2em; line-height: 1.4em; font-size: 78%; } #comments-block dd p { margin: 0 0 .75em; } .deleted-comment { font-style:italic; color:gray; } .feed-links { clear: both; line-height: 2.5em; } #blog-pager-newer-link { float: left; } #blog-pager-older-link { float: right; } #blog-pager { text-align: center; } /* Sidebar Content ----------------------------------------------- */ .sidebar h2 { margin: 1.6em 0 .5em; padding: 4px 5px; background-color: #619bb8; font-size: 100%; color: #333333; } .sidebar ul { margin: 0; padding: 0; list-style: none; } .sidebar li { margin: 0; padding-top: 0; padding-right: 0; padding-bottom: .5em; padding-left: 15px; text-indent: -15px; line-height: 1.5em; } .sidebar { color: #000000; line-height:1.3em; } .sidebar .widget { margin-bottom: 1em; } .sidebar .widget-content { margin: 0 5px; } /* Profile ----------------------------------------------- */ .profile-img { float: left; margin-top: 0; margin-right: 5px; margin-bottom: 5px; margin-left: 0; padding: 4px; border: 1px solid #cccccc; } .profile-data { margin:0; text-transform:uppercase; letter-spacing:.1em; font-weight: bold; line-height: 1.6em; font-size: 78%; } .profile-datablock { margin:.5em 0 .5em; } .profile-textblock { margin: 0.5em 0; line-height: 1.6em; } /* Footer ----------------------------------------------- */ #footer { clear: both; text-align: center; color: #000000; } #footer .widget { margin:.5em; padding-top: 20px; font-size: 85%; line-height: 1.5em; text-align: left; } /** Page structure tweaks for layout editor wireframe */ body#layout #header { width: 750px; } --></style> <link href='https://www.blogger.com/dyn-css/authorization.css?targetBlogID=7803021&zx=274f38bb-4413-4f09-bdbd-c613ffcff189' media='none' onload='if(media!='all')media='all'' rel='stylesheet'/><noscript><link href='https://www.blogger.com/dyn-css/authorization.css?targetBlogID=7803021&zx=274f38bb-4413-4f09-bdbd-c613ffcff189' rel='stylesheet'/></noscript> <meta name='google-adsense-platform-account' content='ca-host-pub-1556223355139109'/> <meta name='google-adsense-platform-domain' content='blogspot.com'/> </head> <body> <div class='navbar section' id='navbar'><div class='widget Navbar' data-version='1' id='Navbar1'><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar/7803021?po\x3d6347967251520208521\x26origin\x3dhttps://gafter.blogspot.com', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script><script type="text/javascript"> (function() { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = '//pagead2.googlesyndication.com/pagead/js/google_top_exp.js'; var head = document.getElementsByTagName('head')[0]; if (head) { head.appendChild(script); }})(); </script> </div></div> <div id='outer-wrapper'><div id='wrap2'> <!-- skip links for text browsers --> <span id='skiplinks' style='display:none;'> <a href='#main'>skip to main </a> | <a href='#sidebar'>skip to sidebar</a> </span> <div id='header-wrapper'> <div class='header section' id='header'><div class='widget Header' data-version='1' id='Header1'> <div id='header-inner'> <div class='titlewrapper'> <h1 class='title'> <a href='https://gafter.blogspot.com/'> Neal Gafter's blog </a> </h1> </div> <div class='descriptionwrapper'> <p class='description'><span>Thoughts about Programming Languages, Science and Philosophy.</span></p> </div> </div> </div></div> </div> <div id='content-wrapper'> <div id='main-wrapper'> <div class='main section' id='main'><div class='widget Blog' data-version='1' id='Blog1'> <div class='blog-posts hfeed'> <div class="date-outer"> <h2 class='date-header'><span>Friday, April 27, 2007</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post'> <a name='6347967251520208521'></a> <h3 class='post-title'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html'>A Consensus Closures JSR Proposal</a> </h3> <div class='post-header-line-1'></div> <div class='post-body'> <p><p>I had set aside work on the closures prototype for a couple of months to write a JSR proposal that represents a consensus among the folks thinking about this area. You can find it at <a href="http://www.javac.info/consensus-closures-jsr.html">http://www.javac.info/consensus-closures-jsr.html</a>. One of the things I learned is that unanimous agreement is rarely possible. There are those who feel that nothing should be done to the Java programming language, and such people will not be swayed by simple but powerful additions. Our latest JSR proposal comes as close to achieving consensus as I believe possible. All but one of the authors of the three widely-discussed closures proposals have agreed to support it.</p> <p>The purpose of the JSR proposal is to define the problems to be solved and circumscribe the permitted solution space. It doesn't mandate a particular solution, though it does offer the <a href="http://www.javac.info/"><span style="font-style: italic;">Closures for Java</span></a> specification as an example of a solution to many (but not all) of the problems. This should not be surprising, as that spec was written specifically in an attempt to satisfy the requirements. Still, the spec is a work in progress.</p> <p>So what is next? I hope we'll have some active discussion at JavaOne about where to go from here.</p></p> <div style='clear: both;'></div> </div> <div class='post-footer'> <p class='post-footer-line post-footer-line-1'><span class='post-comment-link'> </span> <span class='post-icons'> </span> <span class='post-backlinks post-comment-link'> </span> </p> <p class='post-footer-line post-footer-line-2'></p> <p class='post-footer-line post-footer-line-3'></p> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> <h4>12 comments:</h4> <div id='Blog1_comments-block-wrapper'> <dl class='avatar-comment-indent' id='comments-block'> <dt class='comment-author ' id='c1685144654279059536'> <a name='c1685144654279059536'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/13845104548520132930" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-1685144654279059536-13845104548520132930"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Ricky Clarkson"> </a></span></div> <a href='https://www.blogger.com/profile/13845104548520132930' rel='nofollow'>Ricky Clarkson</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-1685144654279059536'> <p> It looks great at first glance. I'm looking forward to the prototype.<BR/><BR/>In BGGA, RestrictedClosure changed to RestrictedFunction, and in this JSR, it appears to have changed back to the former. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177692720000#c1685144654279059536' title='comment permalink'> April 27, 2007 9:52 AM </a> <span class='item-control blog-admin pid-70671471'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=1685144654279059536' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c1628407354442496330'> <a name='c1628407354442496330'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/09242297486267471138" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-1628407354442496330-09242297486267471138"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Unknown"> </a></span></div> <a href='https://www.blogger.com/profile/09242297486267471138' rel='nofollow'>Unknown</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-1628407354442496330'> <p> Is it the strategy then, that the "Closures for Java" will be the basis for an expanded approach that includes features from the other proposals? </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177700700000#c1628407354442496330' title='comment permalink'> April 27, 2007 12:05 PM </a> <span class='item-control blog-admin pid-19298602'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=1628407354442496330' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c3567415891752639242'> <a name='c3567415891752639242'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><img src="//resources.blogblog.com/img/blank.gif" width="35" height="35" alt="" title="Anonymous"> </span></div> Anonymous said... </dt> <dd class='comment-body' id='Blog1_cmt-3567415891752639242'> <p> Glad to hear some consensus is going on (and I'm curious to see a new spec following the consensus). Here's hoping we see closures in Java 7. Thanks much. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177711620000#c3567415891752639242' title='comment permalink'> April 27, 2007 3:07 PM </a> <span class='item-control blog-admin pid-212544397'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=3567415891752639242' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c7101212671754480820'> <a name='c7101212671754480820'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><img src="//resources.blogblog.com/img/blank.gif" width="35" height="35" alt="" title="Anonymous"> </span></div> Anonymous said... </dt> <dd class='comment-body' id='Blog1_cmt-7101212671754480820'> <p> Good news, really appreciate your work! </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177761420000#c7101212671754480820' title='comment permalink'> April 28, 2007 4:57 AM </a> <span class='item-control blog-admin pid-212544397'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=7101212671754480820' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c3519359916078779309'> <a name='c3519359916078779309'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/05396142218343879804" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-3519359916078779309-05396142218343879804"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Ben Galbraith"> </a></span></div> <a href='https://www.blogger.com/profile/05396142218343879804' rel='nofollow'>Ben Galbraith</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-3519359916078779309'> <p> Why is your affiliation in the JSR TBD? Surely Google would sponsor your work in this area; why consider doing it as an independent? </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177792080000#c3519359916078779309' title='comment permalink'> April 28, 2007 1:28 PM </a> <span class='item-control blog-admin pid-1686823367'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=3519359916078779309' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c8195526683246763550'> <a name='c8195526683246763550'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/05077555675379961731" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-8195526683246763550-05077555675379961731"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="past"> </a></span></div> <a href='https://www.blogger.com/profile/05077555675379961731' rel='nofollow'>past</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-8195526683246763550'> <p> @ben:<BR/>I'd speculate that it has something to do with the fact that Google employs both Neal Gafter and Josh Bloch, and the latter apparently is the only one who has not agreed to this proposal. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177945560000#c8195526683246763550' title='comment permalink'> April 30, 2007 8:06 AM </a> <span class='item-control blog-admin pid-158146431'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=8195526683246763550' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c76931319210521479'> <a name='c76931319210521479'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/13063110431935477782" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-76931319210521479-13063110431935477782"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Bharath"> </a></span></div> <a href='https://www.blogger.com/profile/13063110431935477782' rel='nofollow'>Bharath</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-76931319210521479'> <p> Yes. Josh Bloch is conspicuous by his absence. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177949760000#c76931319210521479' title='comment permalink'> April 30, 2007 9:16 AM </a> <span class='item-control blog-admin pid-2042157447'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=76931319210521479' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c2594621294391511123'> <a name='c2594621294391511123'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/11154022780786091493" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-2594621294391511123-11154022780786091493"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Unknown"> </a></span></div> <a href='https://www.blogger.com/profile/11154022780786091493' rel='nofollow'>Unknown</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-2594621294391511123'> <p> Closures and Java Doesn't go together. Java need just a simple solution to handle event programming as Delegates. Closures are more for Dynamic typed languages. And Java is a Mature language doesn't need more features. IF adding more fetures will get bloated and ugly language. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1177980180000#c2594621294391511123' title='comment permalink'> April 30, 2007 5:43 PM </a> <span class='item-control blog-admin pid-406218587'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=2594621294391511123' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c5285668719804815038'> <a name='c5285668719804815038'></a> <div class="avatar-image-container vcard"><span dir="ltr"><a href="https://www.blogger.com/profile/06339534234190675498" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-5285668719804815038-06339534234190675498"><img src="https://resources.blogblog.com/img/blank.gif" width="35" height="35" class="delayLoad" style="display: none;" longdesc="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhEbRxDd5CaQdtpRwrUZS8Popgbo8xxvljNPXbhxQAIEEERCi3v2o-W-f96lmxP1S5TIc1PwJJrpjRIqZzWkdcrcW0P0WucaOzIn3-mOe6qZWLf_YoQ_jClJmhtHbvfA/s45-c/Рома.png" alt="" title="elizarov"> <noscript><img src="//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhEbRxDd5CaQdtpRwrUZS8Popgbo8xxvljNPXbhxQAIEEERCi3v2o-W-f96lmxP1S5TIc1PwJJrpjRIqZzWkdcrcW0P0WucaOzIn3-mOe6qZWLf_YoQ_jClJmhtHbvfA/s45-c/Рома.png" width="35" height="35" class="photo" alt=""></noscript></a></span></div> <a href='https://www.blogger.com/profile/06339534234190675498' rel='nofollow'>elizarov</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-5285668719804815038'> <p> Is there any chance that it will include checked non-local returns, breaks, and continues? That is, is there any plan to replace *unchecked* UnmatchedNonLocalReturn exception with a checked mechanism that will catch such errors at compile-time (rather than at run-time).<BR/><BR/>If there any way to access preliminary version of javac with support of closures, then I can volunteer to write a proof-of-concept implementation for checked non-local returns. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1178106780000#c5285668719804815038' title='comment permalink'> May 02, 2007 4:53 AM </a> <span class='item-control blog-admin pid-727085490'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=5285668719804815038' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author blog-author' id='c7578229519463593179'> <a name='c7578229519463593179'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/08579466817032124881" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-7578229519463593179-08579466817032124881"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Neal Gafter"> </a></span></div> <a href='https://www.blogger.com/profile/08579466817032124881' rel='nofollow'>Neal Gafter</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-7578229519463593179'> <p> @elizarov: That's what RestrictedFunction is for. We looked at making the runtime exception checked, but it turns out not to work. The problems have to do with a mismatch between the static and dynamic behavior of exceptions. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1178115660000#c7578229519463593179' title='comment permalink'> May 02, 2007 7:21 AM </a> <span class='item-control blog-admin pid-1177465903'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=7578229519463593179' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author ' id='c5454811403175215540'> <a name='c5454811403175215540'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/02507174772161899192" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-5454811403175215540-02507174772161899192"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Patrick Viry"> </a></span></div> <a href='https://www.blogger.com/profile/02507174772161899192' rel='nofollow'>Patrick Viry</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-5454811403175215540'> <p> Hi,<BR/><BR/>Let me express a concern about the consensus "closures" proposal (note the quotes around "closures"). I am worried that it mixes two really different things, and that if we don't make it clear right now, we will be responsible for spreading confusion in the heads of generations of programmers.<BR/><BR/>What is a closure ? Intuitively it's a piece of code (as opposed to a piece of data) that is wrapped in a trunk, together with a parameter passing mechanism : you can carry the trunk away with you or send it somewhere else (typically as a callback function), even across a network. Closures naturally lead to function types, so you get all the nice composition properties common in functional programming. Closures also provide some kind of delayed evaluation, since the code inside the trunk is not run until you explicitely ask for it : this is why closures can be used to implement user-defined control structures (the source of most use cases in the BGGA proposal).<BR/><BR/>Let us go back to your trunk containing code. You have sent it away to someone else, it may be now in a place that you didn't even now existed. You definitely do not want this code to suddenly modify or resurrect one of your local variables or more generally mess things up in your current context.<BR/><BR/>On the other hand, if you are using a closure as an implementation for a user-defined control structure, the situation is opposite : the code inside the trunk will never be moved, and you want it to be able to modify local variables or make the current method return.<BR/><BR/>See how the two notions differ ? Syntactically they look similar, they may even have the same type, but the meaning of everything related to context is different. In the first case, modifying local variables from the context is prohibited (unsurprisingly, Java inner classes have the same restriction), <I>return</I> returns from the closure, <I>this</I> refers to the closure itself. In the second case, modifying local variables from the context is allowed, <I>return</I> returns from the enclosing method, and <I>this</I> refers to the instance from the context. Implementation also is completely different : in one case, inner classes or combinators, in the other case inlining.<BR/><BR/>In the nice clean world of functional programming, without imperative variables and without non-local exits, this makes no difference, hence the name "closure" in both cases. But we are talking about Java, an imperative language with a lot of context-dependent features, and we cannot make such an approximation. Earlier versions of the BGGA proposal used the names "synchronous" and "asynchronous" to distinguish both cases. I believe these terms borrowed from concurrent programming can only add to the confusion. Let us try to better express what we are talking about.<BR/><BR/>In the first case, the trunk that you can carry away, we are talking about something quite similar to functions in functional programming (a "closure" in functional programming means a function that refers to local variables from the context -- functional variables or final variables in Java parlance -- and has to carry a local copy of their values). The terms <B>closure</B> or <B>function</B> seem appropriate, although they have recently been much overloaded.<BR/><BR/>In the second case, we are talking about what is commonly known as <B>macro</B> or as <B>call by name</B> (we are talking here about proper macros, not about the infamous preprocessor macros based on text replacement, which lead to incorrect behaviour). In this case, we are not interested in the functional type associated with a closure : did you notice how all use cases in the BGGA proposal dealing with defining control structures have the same type {=>void} or {=>T} ? We are also not interested in the "trunk" part, since we do not want the code to move. We are only interested in the third feature of closures mentioned above, namely delayed evaluation. The term "macro" is well known and understood, and seems a perfect fit for this purpose. You can have a look at a modern implementation of macros for instance in the Nemerle language at http://nemerle.org/Macros.<BR/><BR/>Now we have two different names for the two different concepts. We should also have a way to distinguish them syntactically with an eyeblick, ie. something more than just a keyword. We may even wish to give them different types (possibly with some conversion rules) in order to emphasize the fact that are not the same thing.<BR/><BR/>A last remark : in all the closures proposals I have seen, I deeply miss references to existing languages with similar features. Closures is old stuff (really), and we have to take into account the years of experience accumulated by the community.<BR/><BR/>Cheers,<BR/>Patrick. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1178545800000#c5454811403175215540' title='comment permalink'> May 07, 2007 6:50 AM </a> <span class='item-control blog-admin pid-70330090'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=5454811403175215540' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> <dt class='comment-author blog-author' id='c8018830616621908172'> <a name='c8018830616621908172'></a> <div class="avatar-image-container avatar-stock"><span dir="ltr"><a href="https://www.blogger.com/profile/08579466817032124881" target="" rel="nofollow" onclick="" class="avatar-hovercard" id="av-8018830616621908172-08579466817032124881"><img src="//www.blogger.com/img/blogger_logo_round_35.png" width="35" height="35" alt="" title="Neal Gafter"> </a></span></div> <a href='https://www.blogger.com/profile/08579466817032124881' rel='nofollow'>Neal Gafter</a> said... </dt> <dd class='comment-body' id='Blog1_cmt-8018830616621908172'> <p> @Patrick: Closures can indeed extend the lifetime of local variables beyond the execution of their local scope. That is a historical fact about closures going back to their roots.<BR/><BR/>The control aspects of closures appear in languages such as Smalltalk, Ruby, and Scala. Closures used in this (historical) way are strictly more powerful than macros. See, for example, my previous blog post; although subtle, it was intended to make this point. </p> </dd> <dd class='comment-footer'> <span class='comment-timestamp'> <a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html?showComment=1178549400000#c8018830616621908172' title='comment permalink'> May 07, 2007 7:50 AM </a> <span class='item-control blog-admin pid-1177465903'> <a class='comment-delete' href='https://www.blogger.com/delete-comment.g?blogID=7803021&postID=8018830616621908172' title='Delete Comment'> <img src='https://resources.blogblog.com/img/icon_delete13.gif'/> </a> </span> </span> </dd> </dl> </div> <p class='comment-footer'> <a href='https://www.blogger.com/comment/fullpage/post/7803021/6347967251520208521' onclick=''>Post a Comment</a> </p> </div> </div> </div></div> </div> <div class='blog-pager' id='blog-pager'> <span id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='https://gafter.blogspot.com/2007/05/limitation-of-super-type-tokens.html' id='Blog1_blog-pager-newer-link' title='Newer Post'>Newer Post</a> </span> <span id='blog-pager-older-link'> <a class='blog-pager-older-link' href='https://gafter.blogspot.com/2007/03/closures-for-organizing-your-code.html' id='Blog1_blog-pager-older-link' title='Older Post'>Older Post</a> </span> <a class='home-link' href='https://gafter.blogspot.com/'>Home</a> </div> <div class='clear'></div> <div class='post-feeds'> </div> </div></div> </div> <div id='sidebar-wrapper'> <div class='sidebar section' id='sidebar'><div class='widget BlogArchive' data-version='1' id='BlogArchive1'> <h2>Blog Archive</h2> <div class='widget-content'> <div id='ArchiveList'> <div id='BlogArchive1_ArchiveList'> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2024/'> 2024 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2024/09/'> September </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2023/'> 2023 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2023/08/'> August </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2020/'> 2020 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2020/12/'> December </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2019/'> 2019 </a> <span class='post-count' dir='ltr'>(2)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2019/11/'> November </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2019/08/'> August </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2017/'> 2017 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2017/06/'> June </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2016/'> 2016 </a> <span class='post-count' dir='ltr'>(7)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2016/02/'> February </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2016/01/'> January </a> <span class='post-count' dir='ltr'>(6)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2015/'> 2015 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2015/12/'> December </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2014/'> 2014 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2014/11/'> November </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2010/'> 2010 </a> <span class='post-count' dir='ltr'>(2)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2010/08/'> August </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2010/02/'> February </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2009/'> 2009 </a> <span class='post-count' dir='ltr'>(2)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2009/03/'> March </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2009/02/'> February </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2008/'> 2008 </a> <span class='post-count' dir='ltr'>(4)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2008/08/'> August </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2008/03/'> March </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2008/02/'> February </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2008/01/'> January </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/'> 2007 </a> <span class='post-count' dir='ltr'>(18)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/12/'> December </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/11/'> November </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/10/'> October </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/07/'> July </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/05/'> May </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate expanded'> <a class='toggle' href='javascript:void(0)'> <span class='zippy toggle-open'> ▼  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/04/'> April </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='posts'> <li><a href='https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html'>A Consensus Closures JSR Proposal</a></li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/03/'> March </a> <span class='post-count' dir='ltr'>(4)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/02/'> February </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2007/01/'> January </a> <span class='post-count' dir='ltr'>(4)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/'> 2006 </a> <span class='post-count' dir='ltr'>(20)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/12/'> December </a> <span class='post-count' dir='ltr'>(4)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/11/'> November </a> <span class='post-count' dir='ltr'>(4)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/10/'> October </a> <span class='post-count' dir='ltr'>(3)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/09/'> September </a> <span class='post-count' dir='ltr'>(5)</span> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2006/08/'> August </a> <span class='post-count' dir='ltr'>(4)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2005/'> 2005 </a> <span class='post-count' dir='ltr'>(2)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2005/02/'> February </a> <span class='post-count' dir='ltr'>(2)</span> </li> </ul> </li> </ul> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2004/'> 2004 </a> <span class='post-count' dir='ltr'>(1)</span> <ul class='hierarchy'> <li class='archivedate collapsed'> <a class='toggle' href='javascript:void(0)'> <span class='zippy'> ►  </span> </a> <a class='post-count-link' href='https://gafter.blogspot.com/2004/09/'> September </a> <span class='post-count' dir='ltr'>(1)</span> </li> </ul> </li> </ul> </div> </div> <div class='clear'></div> </div> </div><div class='widget Profile' data-version='1' id='Profile1'> <h2>About Me</h2> <div class='widget-content'> <dl class='profile-datablock'> <dt class='profile-data'> <a class='profile-name-link g-profile' href='https://www.blogger.com/profile/08579466817032124881' rel='author' style='background-image: url(//www.blogger.com/img/logo-16.png);'> Neal Gafter </a> </dt> <dd class='profile-textblock'>Neal Gafter is a Computer Programming Language Designer and Implementer, Amateur Scientist and Philosopher. He works on the Rel compiler at Relational.AI. He previously worked for Microsoft on C#, for Google on Calendar, and for Sun Microsystems on Java. Neal was granted an OpenJDK Community Innovators' Challenge award for his design and implementation of lambda expressions for Java. He is coauthor of <em>Java Puzzlers: Traps, Pitfalls, and Corner Cases</em> (Addison Wesley, 2005). He was a member of the C++ Standards Committee and led the development of C and C++ compilers at Sun Microsystems, Microtec Research, and Texas Instruments. He holds a Ph.D. in computer science from the University of Rochester.</dd> </dl> <a class='profile-link' href='https://www.blogger.com/profile/08579466817032124881' rel='author'>View my complete profile</a> <div class='clear'></div> </div> </div></div> </div> <!-- spacer for skins that want sidebar and main to be the same height--> <div class='clear'> </div> </div> <!-- end content-wrapper --> <div id='footer-wrapper'> <div class='footer no-items section' id='footer'></div> </div> </div></div> <!-- end outer-wrapper --> <script src="//www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type='text/javascript'> _uacct = "UA-605497-1"; urchinTracker(); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/2725212210-widgets.js"></script> <script type='text/javascript'> window['__wavt'] = 'AOuZoY55gAhRlX0EainV6ualUJrsIvG-8w:1740599224147';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d7803021','//gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html','7803021'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '7803021', 'title': 'Neal Gafter\x27s blog', 'url': 'https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html', 'canonicalUrl': 'http://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html', 'homepageUrl': 'https://gafter.blogspot.com/', 'searchUrl': 'https://gafter.blogspot.com/search', 'canonicalHomepageUrl': 'http://gafter.blogspot.com/', 'blogspotFaviconUrl': 'https://gafter.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'en', 'localeUnderscoreDelimited': 'en', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': false, 'isMobileRequest': false, 'mobileClass': '', 'isPrivateBlog': false, 'isDynamicViewsAvailable': false, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Neal Gafter\x26#39;s blog - Atom\x22 href\x3d\x22https://gafter.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22Neal Gafter\x26#39;s blog - RSS\x22 href\x3d\x22https://gafter.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22Neal Gafter\x26#39;s blog - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/7803021/posts/default\x22 /\x3e\n\n', 'meTag': '', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': false, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/f04e4d11442969dd', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': 'Get link', 'key': 'link', 'shareMessage': 'Get link', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': 'Share to Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': 'Share to X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': 'Share to Pinterest', 'target': 'pinterest'}, {'name': 'Email', 'key': 'email', 'shareMessage': 'Email', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27en\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': 'Read more', 'pageType': 'item', 'postId': '6347967251520208521', 'pageName': 'A Consensus Closures JSR Proposal', 'pageTitle': 'Neal Gafter\x27s blog: A Consensus Closures JSR Proposal'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': 'Edit', 'linkCopiedToClipboard': 'Link copied to clipboard!', 'ok': 'Ok', 'postLink': 'Post Link'}}, {'name': 'template', 'data': {'name': 'custom', 'localizedName': 'Custom', 'isResponsive': false, 'isAlternateRendering': false, 'isCustom': true}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': false, 'title': 'A Consensus Closures JSR Proposal', 'description': 'I had set aside work on the closures prototype for a couple of months to write a JSR proposal that represents a consensus among the folks th...', 'url': 'https://gafter.blogspot.com/2007/04/consensus-closures-jsr-proposal.html', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 6347967251520208521}}]); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'lightboxEnabled': true, 'lightboxModuleUrl': 'https://www.blogger.com/static/v1/jsbin/177302283-lbx.js', 'lightboxCssUrl': 'https://www.blogger.com/static/v1/v-css/1964470060-lightbox_bundle.css'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogArchiveView', new _WidgetInfo('BlogArchive1', 'sidebar', document.getElementById('BlogArchive1'), {'languageDirection': 'ltr', 'loadingMessage': 'Loading\x26hellip;'}, 'displayModeFull')); _WidgetManager._RegisterWidget('_ProfileView', new _WidgetInfo('Profile1', 'sidebar', document.getElementById('Profile1'), {}, 'displayModeFull')); </script> </body> </html>