Project Coin的集合增强功能将在JDK8中进行吗? [英] Are Project Coin's collection enhancements going to be in JDK8?

查看:199
本文介绍了Project Coin的集合增强功能将在JDK8中进行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最初项目硬币增强对集合的支持,例如 list [3] 而不是 list.get(3) map [hello ] = 27 而不是 map.put(hello,27)但它们是不在jdk7 。他们会在jdk8吗?我无法找到肯定或否定的明确答案。

Initially Project Coin had enhanced support for collections e.g. list[3] instead of list.get(3) and map["hello"] = 27 instead of map.put("hello", 27) but they were not in jdk7. Are they going to be in jdk8? I could not find a definitive answer for either yes or no.

推荐答案

Brian Goetz简要提及列表,设置,地图(和其他5月30日在Project Lambda邮件列表中的这篇文章中的文字:

Brian Goetz briefly mentions list, set, map (and other possible) literals in this post in the Project Lambda mailing list from 30th May:

http://mail.openjdk.java.net/pipermail/lambda-dev/2012-May/004979.html


为了说明我们可以做得更好的意思,这里有一个替代的
提案,可以从#:结构化文字中获得更多的里程数。
虽然这些计划不适用于8,但我们已经声明我们的
希望为列表,地图,集合等添加结构化文字。#作为
前缀符号,与分隔符结合使用,作为一个结构化的文字构建器,给我们提供了更高的
语法返回(作为奖励,#b
已经与很多语言的结构化文字相关联,一直是
回到许多早期汇编语言,其中#是
立即寻址模式。)

To illustrate what I mean by "we could do better", here's an alternative proposal that gets far more mileage out of #: structured literals. While these plans are not in place for 8, we have already stated our desire to add structured literals for lists, maps, sets, etc. # as a prefix symbol, combined with delimiters, gives us a far higher return-on-syntax as a structured literal builder (as a bonus, # is already associated with structured literals in a lot of languages, going all the way back to many early assembly languages where # was the immediate addressing mode.)

所以对我来说似乎甚至是集合文字不会进入JDK 8,更不用说get / set / put运算符了。很遗憾。

So to me it seems that even the collection literals won't make it into JDK 8, let alone the get/set/put operators. It's a pity.

此外,我在JDK 8里程碑列表中看不到任何与集合文字或新运算符有关的内容:

Also I do not see anything relating to collection literals or new operators in the list of JDK 8 milestones:

http://openjdk.java.net/projects/jdk8/milestones

这篇关于Project Coin的集合增强功能将在JDK8中进行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆