Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@voila
Last active December 30, 2015 05:09
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 voila/7780983 to your computer and use it in GitHub Desktop.
Save voila/7780983 to your computer and use it in GitHub Desktop.
%% A delete_all() implementation
delete_all(X, L) ->
delete_all(X, L, []).
delete_all(_, [], Acc) ->
lists:reverse(Acc);
delete_all(X, [X|Rest], Acc) ->
lists:reverse(Acc) ++ Rest;
delete_all(X, [Y|Rest], Acc) ->
delete_all(X, Rest, [Y|Acc]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment