Skip to content

Instantly share code, notes, and snippets.

@onemouth
Created September 30, 2014 08:44
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 onemouth/43b4384441c91c33ac85 to your computer and use it in GitHub Desktop.
Save onemouth/43b4384441c91c33ac85 to your computer and use it in GitHub Desktop.
TLS
(def atom?
(fn [a]
(not (seq? a))))
(def null?
(fn [a]
(or
(nil? a)
(= () a))))
(def lat?
(fn [l]
(loop [l l]
(cond
(null? l) true
(and (seq? l) (atom? (first l))) (recur (rest l))
:else false))))
(def member?
(fn [a lat]
(loop [lat lat]
(cond
(null? lat) false
(= (first lat) a) true
:else (recur (rest lat))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment