elixir-lang/elixir — pull request #1339 by yrashk (2013-06-29 22:57:43+00:00)
Title: defrecordp/3

The motivation for this is simple:

1. I do want to define multiple private records per module and be able to distinguish them
2. I don't want to memorize `deffunctions`/`defmacros` API
3. In many cases, even a single `defrecordp` in the module should rather have a different tag, for example a module with a `gen_server` and a `defrecordp` for its state. Currently, it'be something like this:

```elixir
defmodule MyServer do
use GenServer.Behaviour
defrecordp :state, data: nil
end
```

The problem with this is that the tuples will look like `{MyServer, nil}` which is far from being ideal. With this pull request, one can do this:

```elixir
defmodule MyServer do
use GenServer.Behaviour
defrecordp State, :state, data: nil
end
```

which will have the tag as `MyServer.State` or

```elixir
defmodule MyServer do
use GenServer.Behaviour
defrecordp :state, :state, data: nil
end
```

which will have the tag as `:state`