简体   繁体   English

Erlang数据类型

[英]Erlang data types

What is the benefit of having string as a list of integers rather than an independent data type in Erlang? 在Erlang中将字符串作为整数列表而不是独立的数据类型有什么好处? Is this to make the string manipulation easier and more efficient? 这是否使字符串操作更容易和更有效? Are there any other reasons for this? 还有其他原因吗?

I believe (TM) that the only benefit was to allow them to implement wide character representations (unicode, utf-x, ...) in a robust way. 我相信(TM)的唯一好处是允许他们以健壮的方式实现宽字符表示(unicode,utf-x等)。 On the down side, the performance is much less efficient than linear byte arrays. 不利的一面是,性能远不如线性字节数组有效。 That said, Erlang was never really meant to be used for heavy string manipulations and so the performance of doing so shouldn't matter. 就是说,Erlang从来没有真正打算用于繁重的字符串操作,因此这样做的性能无关紧要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM