Created
April 26, 2015 07:27
-
-
Save stochastic-thread/60e08655508b3b4b80c5 to your computer and use it in GitHub Desktop.
Are these two functions "the same" ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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