Created
September 30, 2014 08:44
-
-
Save onemouth/43b4384441c91c33ac85 to your computer and use it in GitHub Desktop.
TLS
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
(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