Skip to content

Instantly share code, notes, and snippets.

@knewter
Created December 27, 2013 01:43
Show Gist options
  • Save knewter/8141284 to your computer and use it in GitHub Desktop.
Save knewter/8141284 to your computer and use it in GitHub Desktop.
Can someone explain this?
iex(23)> out = Enum.reduce([4], <<>>, fn(elem, accum) -> accum <> <<elem :: size(4)>> end)
<<4::size(4)>>
iex(24)> <<4::size(4)>> <> <<5::size(4)>>
"E"
iex(25)> out <> <<5::size(4)>>
** (ArgumentError) argument error
iex(25)> out == <<4::size(4)>>
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment