• Skip to primary navigation
  • Skip to content
  • Skip to footer
Clojure Diary Clojure Diary
  • Search
  • Book
  • Code
  • Videos
  • Donate

    Get every nth element from a sequence in Clojure

    less than 1 minute read

    Notes

    ;; every_nth_element.clj
    
    (def a-list (range 60))
    
    (defn nth-elements [n coll]
      (map last (partition n coll)))
    
    (nth-elements 12 a-list)
    

    Updated: December 5, 2022

    Twitter Facebook LinkedIn
    Previous Next

    You May Also Enjoy

    map operations

    1 minute read

    Understanding Probabilistic Computing with Clojure

    less than 1 minute read

    Clojure Jobs - Fixing it

    1 minute read

    Creating code on the fly using Clojure eval

    less than 1 minute read

    • Feed
    © 2025 Clojure Diary. Powered by Jekyll & Minimal Mistakes.