Skip to content

Instantly share code, notes, and snippets.

@stochastic-thread
Created April 26, 2015 07:27
Show Gist options
  • Save stochastic-thread/60e08655508b3b4b80c5 to your computer and use it in GitHub Desktop.
Save stochastic-thread/60e08655508b3b4b80c5 to your computer and use it in GitHub Desktop.
Are these two functions "the same" ?
def delete(bucket, key) do
Agent.get_and_update(bucket, &HashDict.pop(&1, key))
end
vs.
def delete(bucket, key) do
Agent.get_and_update(bucket,
fn dict -> HashDict.pop(dict, key)
end)
end
Because they change the implementation at this link from the one on lines 1-3 to the one on lines 7-11 (my file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment