Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns firstclojureprog.core)
- (defn foo [x]
- (println x "Hello, World!"))
- (defn sum [l]
- (if (empty? l)
- 0
- (+ (first l)(sum (rest l)))))
- (defn fact [n]
- (if (zero? n)
- 1
- (* n (fact (- n 1)))
- )
- )
- ;; (foo "")
- (println (sum '(1 2 3)))
- (print (fact 10))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement