Guest User

Untitled

a guest
Apr 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. (def qq [ 1 -1 3 4 -4 -5 6 -10 1345 -32 ] )
  2.  
  3. (defn filter-neg[g]
  4. (if (neg? g)
  5. g))
  6.  
  7. (filter-neg 3)
  8.  
  9. (defn produce-with-fun[x prod-fun]
  10. (lazy-seq
  11. (when (seq x)
  12. (if-let [f (prod-fun (first x))]
  13. (cons f (red (rest x) prod-fun))
  14. (red (rest x) prod-fun)))))
  15.  
  16. (produce-with-fun qq filter-neg)
Add Comment
Please, Sign In to add comment