是“新”在Erlang部分的官方标准,我们应该用它吗? [英] Is "new" in Erlang part of the official standard and should we use it?

查看:136
本文介绍了是“新”在Erlang部分的官方标准,我们应该用它吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问这个问题,因为我注意到很多OpenSource Erlang项目都使用new来将参数传递给Erlang模块,但同时我听说新不是官方语言的一部分,可能不是支持,如果它包含错误。在我自己的项目中使用它之前,我想澄清这个问题。



更新:
我以前问过Erlang官方邮件列表中的答案:



http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:49535:201002:aicfhmngkhodmclhlnak

解决方案

没有官方的Erlang标准,这很难成为其中的一部分。



OTP / Erlang团队似乎只有当他们记录他们时才将功能视为官方的。参数化模块(即功能名称)未记录。 OTP / Erlang团队决定做的是接近于Erlang标准。



我个人认为没有吸引力让Erlang看起来像是一些东西不是。它只会使这种语言有更多的知识和教学规则,而只会让人失望的是那些希望一切都像过去的OO背景的人。增加复杂性并不是很强大。



参数化模块目前只是一个模块名称和参数化模块的实例变量。所以这只是一个隐藏几个参数的外部函数调用。


I ask this question as I have noticed that alot of OpenSource Erlang projects use "new" to pass parameters to Erlang modules, yet I hear at the same time that "new" is not part of the official language and may not be supported if it contains bugs. Before I use it in my own project I would like to clarify this issue.

Update: I have since asked on the official Erlang mailing list for an answer:

http://www.erlang.org/cgi-bin/ezmlm-cgi?4:mss:49535:201002:aicfhmngkhodmclhlnak

解决方案

There is no official Erlang standard, that makes it difficult to be part of it.

The OTP/Erlang team seem to only consider features as official if they have documented them. Parameterized modules (that is the feature's name) is not documented. What the OTP/Erlang team decide to do is as close to an Erlang standard as we have.

Personally I don't see the attraction to make Erlang appear like something it is not. It only makes the language have more rules to know and teach, and it only leads to disappointment from those that expect everything to be like their past OO background. It is not powerful to add complexity.

Implementation-wise (an abstraction that many exploit) the parameterized module is currently just a tuple of the module name and the parameterized module's "instance variables". So it is just an external function call that hide a few of the parameters.

这篇关于是“新”在Erlang部分的官方标准,我们应该用它吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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