Skip to content

Instantly share code, notes, and snippets.

@jonte
Created January 4, 2011 14:24
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 jonte/764812 to your computer and use it in GitHub Desktop.
Save jonte/764812 to your computer and use it in GitHub Desktop.
Add an entry to a list without causing a dupe
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