reverse method returns a sequence with its order reversed. A Clojure sequence is a data storage structure that holds a collection of data objects. It can be seen as a logical list. The
seq method builds a sequence.
The code snippet below shows the use of the
reverse method accepts one input argument: a Clojure sequence. The input argument in the code snippet above is
reverse method returns a sequence with the same elements as the input sequence but with their order reversed. When the code snippet is executed, it returns a sequence containing all values in
seq1 with their order reversed. Let’s look at an example.
(ns clojure.examples.example (:gen-class)) (defn revers  (def seq1 (seq [1 2 8 9 1 0 6 8 2])) (println (reverse seq1))) (revers)
reversemethod to reverse the order of elements in
printlnto print the result returned by
View all Courses