Last active
September 6, 2015 15:34
-
-
Save CyrusNuevoDia/6c5772fd197e5b76fc04 to your computer and use it in GitHub Desktop.
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_all(collection, value) when is_list(collection) do | |
List.foldr collection, [], fn | |
x, acc when x == value -> | |
acc | |
x, acc -> | |
[x|acc] | |
end | |
end |
Apparently you can't use ^value
to match within the anonymous function's heads. I tested this and it works.
Yup, that does it. Thanks! I'll update the original post with the this in the coming days!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! I'll add that to the original post tonight!