Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The strict MLs often have a `lazy` keyword, but it's definitely not as tidy as Haskell for this use-case. I'm sure a clever Clojure macro could be devised for the same!


Functions like map and range return lazy lists in Clojure. This is how I'd implement zip:

   (def zip (partial map vector))

   ;;Usage:
   (zip (range) [:a :b :c])
   ;;=> ([0 :a] [1 :b] [2 :c])




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: