2020-05-31 19:54:38
Elixirに Records というものがあるらしい.
elixirのectoのリポジトリのGitのコミットログを見ていたら defrecord とかいうのがあった。
リポジトリ: https://github.com/elixir-ecto/ecto
hexdocsでdefrecord見たらRecordsの説明がありました。
Records are simply tuples where the first element is an atom:https://hexdocs.pm/elixir/Record.html
最初の要素がatomのタプルがRecordsだそうです。続いて以下の説明がありました。
In Elixir, records are used mostly in two situations:
- to work with short, internal data
- to interface with Erlang recordshttps://hexdocs.pm/elixir/Record.html
Erlangにもrecordsがあるらしいく、Elixirではインターフェースとして使われるらしいです。良く分からない。
ちなみに以下のコミットでdefstructに変更していました。
コミットハッシュ: 9cecefa52179187ee9b579c28a611e434cd4a49e