পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Friday, January 27, 2017

Clojure - Lists

List is a structure used to store a collection of data items. In Clojure, the List implements the ISeq interface. Lists are created in Clojure by using the list function.

Example

Following is an example of creating a list of numbers in Clojure.
(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (list 1 2 3 4)))
(example)

Output

The above code produces the following output.
(1 2 3 4)
Following is an example of creating a list of characters in Clojure.
(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (list 'a 'b 'c 'd)))
(example)
The above code produces the following output.
(a b c d)
Following are the list methods available in Clojure.
S.No. Lists & Description
1 list* Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence.
2 first This function returns the first item in the list.
3 nth This function returns the item in the ‘nth’ position in the list.
4 cons Returns a new list wherein an element is added to the beginning of the list.
5 conj Returns a new list wherein the list is at the beginning and the elements to be appended are placed at the end.
6 rest Returns the remaining items in the list after the first item.

No comments:

Post a Comment