tag:blogger.com,1999:blog-5427069094580312550.post5058475648963340796..comments2023-12-23T21:48:09.231-08:00Comments on Code To Joy: The Forgotten Argument for Closures in JavaMichael Easterhttp://www.blogger.com/profile/14799771593145201161noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5427069094580312550.post-90158454978358229182009-02-22T04:31:00.000-08:002009-02-22T04:31:00.000-08:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-44658607894721740892009-02-17T00:46:00.000-08:002009-02-17T00:46:00.000-08:00This comment has been removed by a blog administrator.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-46789070286110445992009-01-18T22:41:00.000-08:002009-01-18T22:41:00.000-08:00This comment has been removed by a blog administrator.wow power levelinghttps://www.blogger.com/profile/17740059839891957088noreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-82445111504676284752008-06-25T05:57:00.000-07:002008-06-25T05:57:00.000-07:00In the JavaOne talk I didn't see anything that was...In the JavaOne talk I didn't see anything that was closure specific, inner classes with short syntax would be just as elegant. Inner classes have many advantages in this context, like inheritance, named and documented actions, and thread safety. With closures you need closure conversions and restricted closures for parallel operations and you still don't have inheritance and you still need to deal with a two type systems.hlovatthttps://www.blogger.com/profile/07048859648718746436noreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-36945743076283258532008-06-24T19:53:00.000-07:002008-06-24T19:53:00.000-07:00Everyone should definitely check out the link post...Everyone should definitely check out the link posted by Alex above. This prime stuff and absolutely a window to the future for parallelism in Java.<BR/><BR/>As Alex mentions, the final slides show closures in action.Unknownhttps://www.blogger.com/profile/13278682771280222055noreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-90145422598499622472008-06-24T19:34:00.000-07:002008-06-24T19:34:00.000-07:00@Alex. Thanks mate@rektide. I think we agree that ...@Alex. Thanks mate<BR/><BR/>@rektide. I think we agree that it would be nice to have examples. However, your comment reads a bit as though I am suggesting there is a lack of understanding for what closures buy us. For me, this is not true: closures can be very useful. IMO, they are a 'niche tool' compared to say, collections, but the truth is Java has successfully evolved to the point where 'niche' is the new frontier.Unknownhttps://www.blogger.com/profile/13278682771280222055noreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-37282381268539899652008-06-24T09:34:00.000-07:002008-06-24T09:34:00.000-07:00Much in line with what you are saying, I myself am...Much in line with what you are saying, I myself am hobbled by a lack of understanding for what closures grant you: there are already many cases where you can use Continuation Passing Style data structures and cooperative yield already, it just takes some careful engineering of your program. NIO is ideal for this, & the Servlets 3.0 spec should enable something akin to continuations in the webserver. I'd love to see some good examples of functionality continuations grant thats not possible with code-level CPS alone.rektidehttps://www.blogger.com/profile/03381475657715288786noreply@blogger.comtag:blogger.com,1999:blog-5427069094580312550.post-49367911741122167922008-06-23T23:13:00.000-07:002008-06-23T23:13:00.000-07:00You can see Brian Goetz's examples from his concur...You can see Brian Goetz's examples from his concurrency talk at JavaOne at <A HREF="http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-5515&yr=2008&track=javase" REL="nofollow">this page</A> which links to both the audio recording and PDF. <BR/><BR/>In the slides, you can see a non-closure example in slide 28 and the closures version at the end in slide 34. I would reproduce them here but it would not be pretty. <BR/><BR/>If you're interested in concurrency, you cannot go wrong listening to the audio and reading the slides for this talk - one of the highlights of JavaOne 2008 for me.Alex Millerhttps://www.blogger.com/profile/01929662536395624733noreply@blogger.com