
In this guide, we will discuss Clojure Lists first. This function returns the first item in the list.
Syntax
Following is the syntax.
(first lst)
Parameters β βlstβ is the list of items.
Return Value β The first value from the list.
Example
Following is an example of first in Clojure.
(ns clojure.examples.example (:gen-class)) (defn example [] (println (first (list 1 2,3)))) (example)
Output
The above program produces the following output.
1
Next Topic : Click Here
Pingback: Clojure - list* | Adglob Infosystem Pvt Ltd
Pingback: Clojure - Lists | Adglob Infosystem Pvt Ltd