Skip to content

Instantly share code, notes, and snippets.

@TylerPachal
Created September 4, 2020 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TylerPachal/581e826754d7efac5bf041e5fe88a4f6 to your computer and use it in GitHub Desktop.
Save TylerPachal/581e826754d7efac5bf041e5fe88a4f6 to your computer and use it in GitHub Desktop.
# Do not do this in Elixir
def increment(number) do
# Because of lexical scoping, this will have no impact to anything
# outside the scope of this function.
number = number + 1
end
count = 0
increment(count)
IO.inspect(count) # 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment