# Binary syntax

**URL:** <https://forum.elixirforum.com/t/binary-syntax/15729>\
**Category:** Questions\
**Tags:** ecto\
**Created:** [August 9, 2018, 11:59pm UTC](https://forum.elixirforum.com/t/binary-syntax/15729 "2018-08-09T23:59:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![7stud](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/7/57b2e6/32.png) [@7stud](https://forum.elixirforum.com/u/7stud)\
**Post date:** [August 9, 2018, 11:59pm UTC](https://forum.elixirforum.com/t/binary-syntax/15729/1 "2018-08-09T23:59:19Z")

</div>

I can do this:

```
iex(22)> <<"hello", <<>> >>
"hello"

```

But not this:

```
iex(23)> x = <<>>
""

iex(24)> <<"hello", x >>
** (ArgumentError) argument error

```

Why?

---

<div class="post-metadata">

**Author:** ![kokolegorille](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/kokolegorille/32/4784_2.png) [@kokolegorille](https://forum.elixirforum.com/u/kokolegorille)\
**Post date:** [August 10, 2018, 12:29am UTC](https://forum.elixirforum.com/t/binary-syntax/15729/2 "2018-08-10T00:29:38Z")

</div>

From [Kernel.SpecialForms documentation](https://hexdocs.pm/elixir/Kernel.SpecialForms.html#%3C%3C%3E%3E/1).

> Variables or any other type need to be explicitly tagged:

This would have worked

```elixir
iex(1)> x = <<>>
iex(2)> <<"hello", x::binary >>              
"hello"

```

You can see the difference with

```elixir
iex(3)> quote do <<"hello", x >> end
{:<<>>, [], ["hello", {:x, [], Elixir}]}
iex(4)> quote do <<"hello", x::binary >> end 
{:<<>>, [], ["hello", {:::, [], [{:x, [], Elixir}, {:binary, [], Elixir}]}]}

```

---

<div class="post-metadata">

**Author:** ![7stud](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/7/57b2e6/32.png) [@7stud](https://forum.elixirforum.com/u/7stud)\
**Post date:** [August 10, 2018, 12:38am UTC](https://forum.elixirforum.com/t/binary-syntax/15729/3 "2018-08-10T00:38:21Z")

</div>

Thanks!
