Guest User

Untitled

a guest
Aug 16th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn pls1 [x]
  2.   (+ 1 x))
  3.  
  4. (defn pls2 [x]
  5.   (+ 2 x))
  6.  
  7. (defn doit []
  8.   (map (fn [i f]
  9.          (f i))
  10.        '(1 2 3 4 5)
  11.        (cycle '(pls1 pls2))))
  12. ;produces (nil nil nil nil nil)
  13.  
  14.  
  15. (defn doit []
  16.   (map (fn [i f]
  17.          (+ 1 i))
  18.        '(1 2 3 4 5)
  19.        (cycle '(pls1 pls2))))
  20. ;while this works for some and produces (2 3 4 5 6)
Advertisement
Add Comment
Please, Sign In to add comment