TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Java 7: Oracle pushes a first version of closures

85 点作者 budu将近 15 年前

9 条评论

bnoordhuis将近 15 年前
The syntax won't win beauty pageants but I like how they retrofitted lambdas onto interfaces so you can do something like:<p><pre><code> Collections.sort(list, (Comparator) #(String a, String b) { return a.compareToIgnoreCase(b); });</code></pre>
评论 #1392806 未加载
评论 #1392887 未加载
strebler将近 15 年前
Look at what the cat dragged in - a syntax for closures in Java.
评论 #1392701 未加载
评论 #1392698 未加载
评论 #1392699 未加载
radu_floricica将近 15 年前
I _really_ didn't expect to say I love Oracle. But in hindsight, better productivity for the Java platform is a huge thing for them.
评论 #1392976 未加载
评论 #1392831 未加载
WilliamLP将近 15 年前
I think waiting for Oracle to do something with Java 7 at this point is like believing Lucy will let you kick the football this time.
评论 #1393810 未加载
评论 #1393275 未加载
jared314将近 15 年前
Good or bad, I am just happy they are actually doing something. (Wow, that is depressing.)
BonoboBoner将近 15 年前
Good to know that they at least work on it and dont delay it till jdk8. This will be a great addition to the jdk for alternative-language-developers just like MethodHandles allowing them to compete with Java performance-wise.
euroclydon将近 15 年前
What's with the "#" sign? Is that new for lambdas, or an existing Java symbol?
评论 #1393611 未加载
评论 #1392973 未加载
评论 #1393574 未加载
jrockway将近 15 年前
None of these closures actually close over any state. Is that feature going to exist, or are these really just C-style function pointers?
评论 #1394201 未加载
morphir将近 15 年前
now the blob-programmer can create compound blobs out of smaller atomic blobs.
评论 #1392776 未加载