পৃষ্ঠাসমূহ

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 - Sets

Sets in Clojure are a set of unique values. Sets are created in Clojure with the help of the set command.

Example

Following is an example of the creation of sets in Clojure.
(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (set '(1 1 2 2))))
(example)

Output

The above code produces the following output.
#{1,2}
Following are the methods available in Clojure for sets.
S.No. Sets & Description
1 sorted-set Returns a sorted set of elements.
2 get Returns the element at the index position.
3 contains? Finds out whether the set contains a certain element or not.
4 conj Appends an element to the set and returns the new set of elements.
5 disj Disjoins an element from the set.
6 union Disjoins an element from the set.
7 difference Return a set that is the first set without elements of the remaining sets.
8 intersection Return a set that is the intersection of the input sets.
9 subset? Is set1 a subset of set2?
10 superset? Is set1 a superset of set2?

No comments:

Post a Comment