`
mryufeng
  • 浏览: 991520 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Internal Representation of Records

阅读更多
8.7 Internal Representation of Records

Record expressions are translated to tuple expressions during compilation. A record defined as

-record(Name, {Field1,...,FieldN}).

is internally represented by the tuple

{Name,Value1,...,ValueN}

where each ValueI is the default value for FieldI.

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.
分享到:
评论
2 楼 mryufeng 2009-03-06  
不多余 因为类似is_record(xxx)什么的需要这个信息
1 楼 cryolite 2009-03-06  
好多数据结构底层都是tuple实现的,例如gb_trees
有个疑问:record存放到mnesia数据库中时,record的Name岂不是太多余了,纯粹浪费磁盘空间?

相关推荐

    Algorithms and Data Structures - Niklaus Wirth

    **Representation of Arrays, Records, and Sets**: This section discusses the internal representation of these data structures in memory, including how they are accessed and manipulated. - **...

    php.ini-development

    You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to "mb_output_handler", character ; encoding will be transparently converted to the ...

    DebuggingWithGDB 6.8-2008

    Table of Contents Summary of gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

    最新版的DebuggingWithGDB7.05-2010

    Table of Contents Summary of gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Free Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

    Debugging with GDB --2003年6.0

    Table of Contents Summary of gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Free software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

Global site tag (gtag.js) - Google Analytics