为什么 ActionScript 没有“泛型"? [英] Why doesn't ActionScript have "generics"?

查看:23
本文介绍了为什么 ActionScript 没有“泛型"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我为什么 ActionScript 3(一种静态类型语言)没有泛型?工作太多了吗?历史事件?有什么方法可以伪造"我还没有捡到的东西?

Can anyone tell me why ActionScript 3, a statically typed language, doesn't have generics? Is it too much work? A historical thing? Is there some way to "fake" it that I haven't picked up yet?

编辑:非常感谢您的回答!Vector 类基本上就是我要找的,其他信息也很有帮助.

Edit: thanks a lot for the answers! The Vector class is basically what I was looking for, and the other information was helpful too.

推荐答案

新的 矢量类 是一种泛型形式,Actionscript 3 现在在为 Flash Player 10 编译时支持这种形式.它们尚不支持您自己的泛型类的规范.

The new Vector class is a form of generics that Actionscript 3 now supports when compiled for Flash Player 10. They don't support the specification of your own generic classes, yet.

我认为 Adob​​e 最终会实施 ES4 标准.如果他们有一个可以更快地将他们推向正确方向的竞争对手,那就太好了.当他们迁移到 CS4 时,我对 AS3 的更新有更多期待,但我认为革命性的 Vector 类就足够了.

I think Adobe will implement the ES4 standard eventually. It would be nice if they had a competitor who could push them quicker in the right direction. I was expecting a little more from the updates to AS3 when they moved to CS4, but I suppose the revolutionary Vector class will have to suffice.

看起来他们花了很多时间来加强 Flex 和 AIR 的库,所以也许他们以后会回去改进语言支持,但这可能不是真正的优先事项.请记住,Adobe 是为了钱,而不是为了制作最甜蜜的语言的感觉.

It looks like they spent a lot of time beefing up the libraries for Flex and AIR, so maybe they'll go back to improving the language support later, but it probably isn't a real priority. Remember, Adobe is in it for the money, not for the feel good of making the sweetest possible language.

这篇关于为什么 ActionScript 没有“泛型"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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