fork(2) download
  1. (def null?
  2. (fn [a]
  3. (or
  4. (nil? a)
  5. (= () a))))
  6.  
  7. (def rember
  8. (fn [ a lat]
  9. (cond
  10. (null? lat) '()
  11. true (cond
  12. (= (first lat) a) (rest lat)
  13. true (cons (first lat)
  14. (rember
  15. a (rest lat)))))))
  16.  
  17. (println (rember 'banana '(apple banana orange)))
  18.  
  19. (def firsts
  20. (fn [l]
  21. (cond
  22. (null? l) '()
  23. true (cons (first (first l))
  24. (firsts (rest l))))))
  25.  
  26. (println (firsts '((large burger)(fries coke)(chocolate sundae))))
Success #stdin #stdout 1.54s 389120KB
stdin
Standard input is empty
stdout
(apple orange)
(large fries chocolate)