Created
January 4, 2011 14:24
-
-
Save jonte/764812 to your computer and use it in GitHub Desktop.
Add an entry to a list without causing a dupe
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
New = 1, | |
CompleteList = [1,2,3,4,5], % 1 is already in list | |
NoDupes = [New | lists:delete(New, CompleteList)]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment