Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 897839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:56:52+00:00 2026-05-15T14:56:52+00:00

Novice question, but I don’t really understand why there are so many operations for

  • 0

Novice question, but I don’t really understand why there are so many operations for constructing maps in clojure.

You have conj, assoc and merge, but they seem to more or less do the same thing?

(assoc {:a 1 :b 2} :c 3)
(conj {:a 1 :b 2} {:c 3})
(merge {:a 1 :b 2} {:c 3})

What’s really the difference and why are all these methods required when they do more or less the same thing?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:56:53+00:00Added an answer on May 15, 2026 at 2:56 pm

    assoc and conj behave very differently for other data structures:

    user=> (assoc [1 2 3 4] 1 5)
    [1 5 3 4]
    user=> (conj [1 2 3 4] 1 5)
    [1 2 3 4 1 5]
    

    If you are writing a function that can handle multiple kinds of collections, then your choice will make a big difference.

    Treat merge as a maps-only function (its similar to conj for other collections).

    My opinion:

    • assoc – use when you are ‘changing’ existing key/value pairs
    • conj – use when you are ‘adding’ new key/value pairs
    • merge – use when you are combining two or more maps
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a Delphi novice, but I'm trying to understand the relationship between TApplication
I am novice in sharepoint programming. I have a following code: SPWorkflowTask task =
I am a novice in the world of source/version control and I have been
I notice that StackOverflow has a views count for each question and that these
As a novice developer who is getting into the rhythm of my first professional
I am a novice programmer who is trying to teach myself to code, specifically
As a novice, I've spent time learning a smattering of C and a fair
I am a AS3 novice learning PureMVC and want to write code following best
I'm a very novice OCaml programmer so please forgive me if this is a
I'm a Python novice, trying to use pyCurl. The project I am working on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.