# Interpolation inside a variable?

**URL:** <https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637>\
**Category:** Questions\
**Tags:** eex, elixir\
**Created:** [January 29, 2022, 6:42pm UTC](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637 "2022-01-29T18:42:19Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![benwilson512](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/32/1457_2.png) [@benwilson512](https://forum.elixirforum.com/u/benwilson512)\
**Post date:** [January 29, 2022, 9:33pm UTC](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637/5 "2022-01-29T21:33:43Z")

</div>

It’s all still sort of weird though, it’d be much more idiomatic to have the key of the `computers` map just be the `id` itself, I don’t see how it helps to have it surrounded by extra atom or string content:

```elixir
%{
  1 => %Computer{},
  2 => %computer{}, etc
}

```

Then you can simply look up the computers by `id`. BUT even this is sort of weird, it would make more sense for the `@computers` assign to be an ordinary list where the items are simply sorted already into the desired order, and then it can be iterated through as `for computer <- @computers do` and we skip all of the extra lookups.

---

_[View the full topic](https://forum.elixirforum.com/t/interpolation-inside-a-variable/45637)._
