Clojure – Lists rest

Clojure lists rest

In this guide, we will discuss Clojure Lists rest. Returns the remaining items in the list after the first item.

Syntax

Following is the syntax.

(rest lst)

Parameters βˆ’ β€˜lst’ is the list of items.

Return Value βˆ’ A list of items with the first item removed.

Example

Following is an example of rest in Clojure.

(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (rest (list 1 2,3))))
(example)

Output

The above program produces the following output.

(2 3)

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply