We use range to iterate over elements in a variety of built-in data structures. Let’s see how to use range with some of the data structures we’ve learned.
To run the program, write the code in a file named core.clj under a directory example and run it using the clj command.
In this example, we’ve demonstrated how to sum elements in a vector, iterate with indices, handle maps and keys, and iterate over strings by their Unicode code points in Clojure. Now that we can work with these fundamental data structures and iteration methods, let’s learn more about the language.