2011年3月19日土曜日

Erlang record Erlangドキュメントの訳

ダメダメな訳だが、まぁないよりはマシ?


Record

A record is a data structure for storing a fixed number of elements.
(recordは固定された数値のエレメントを記憶するためのデータ構造)

It has named fields and is similar to a struct in C.
(C言語の構造体と似ている。)

However, record is not a true data type.
(しかしながら、recordはtrueデータタイプではない。)

Instead record expressions are translated to tuple expressions during compilation.
(recordの表現方法はtupleの表現方法に翻訳される。)

Therefore, record expressions are not understood by the shell unless special actions are taken. See shell(3) for details.
(recordの表現ほうほうはシェルに理解されない。特別な動作をしない限り。詳しくはshell(3)を見てくれ)

Examples:

-module(person).
-export([new/2]).

-record(person, {name, age}).

new(Name, Age) ->
    #person{name=Name, age=Age}.

1> person:new(ernie, 44).
{person,ernie,44}


Read more about records in Records. More examples can be found in Programming Examples.
(もっと知りたい場合、Recordsのrecordsを見てほしい。プログラミング例をもっと見れるぞ。)

0 件のコメント:

コメントを投稿