Skip to content

Commit

Permalink
Add a note about GC considerations with atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
jbranchaud committed Jul 7, 2016
1 parent ebd901f commit 38d2833
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions elixir/dynamically-generating-atoms.md
@@ -1,15 +0,0 @@
# Dynamically Generating Atoms

> Atoms are constants where their name is their own value.
The use of atoms like `:ok` and `:error` show up all over the place in
Elixir. These are atoms that tend to be statically defined. Atoms can also
be dynamically defined using string interpolation.

For example, I can generate a handful of atoms by mapping over a range of
integers.

```elixir
> Enum.map(1..5, &(:"some_atom_#{&1}"))
[:some_atom_1, :some_atom_2, :some_atom_3, :some_atom_4, :some_atom_5]
```

0 comments on commit 38d2833

Please sign in to comment.