首页 > 代码库 > 学习:record用法
学习:record用法
详情请参考官网:http://www.erlang.org/doc/reference_manual/records.html
http://www.erlang.org/doc/programming_examples/records.html
1. record本质上是tuple.
2.获取record的结构相关的信息的函数:
To each module using records, a pseudo function is added during compilation to obtain information about records:
record_info(fields, Record) -> [Field] record_info(size, Record) -> Size
Size is the size of the tuple representation, that is one more than the number of fields.
In addition, #Record.Name returns the index in the tuple representation of Name of the record Record. Name must be an atom.
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。