Skip to content

Instantly share code, notes, and snippets.

@lowellbander
Last active October 27, 2015 19:28
Show Gist options
  • Select an option

  • Save lowellbander/bc51319f0f318560328c to your computer and use it in GitHub Desktop.

Select an option

Save lowellbander/bc51319f0f318560328c to your computer and use it in GitHub Desktop.
(defun unique (items)
(cond
((null items) t)
((contains (first items) (rest items)) nil)
(t (unique (rest items)))
)
)
(defun contains (needle haystack)
(cond
((null haystack) nil)
((equal needle (first haystack)) t)
(t (contains needle (rest haystack)))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment