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 6890451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:17:01+00:00 2026-05-27T06:17:01+00:00

There has to be a simple way to do this, and I am obviously

  • 0

There has to be a simple way to do this, and I am obviously missing it 😐

How do you add the items in a list\sequence (not clear on the difference) in clojure?

I’ve tried the following:

Clojure> (add [1 2 3])
java.lang.RuntimeException: Unable to resolve symbol: add in this context
Clojure> (+ [1 2 3])
java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number
Clojure> (apply merge-with + [1 2 3])
java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
Clojure> (add-items [1 2 3])
java.lang.RuntimeException: Unable to resolve symbol: add-items in this context
  • 1 1 Answer
  • 0 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-27T06:17:01+00:00Added an answer on May 27, 2026 at 6:17 am
    (+ 1 2 3)
    

    …will do it. @Nathan Hughes’s solution:

    (apply + [1 2 3]) 
    

    …works if you have a reference to the sequence rather than defining it inline, e.g.:

    (def s [1 2 3])
    ; (+ s) CastClassException
    (apply + s) ; 6
    

    As @4e6 notes, reduce also works:

    (reduce + s) ; 6
    

    Which is better? Opinions vary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There has GOT to be a simple way to programmatically render HTML into a
Is there an open-source toolkit out there that has a few simple canvas drawing
There has to be a better way of writing the js in my function....
Sorry for the unlearned nature of this question. If there's a simple answer, just
Is there a simple .Net way to do hierarchical sorting Table... A|B|C ----- 1|2|5
I'm using objective-c (obviously, I guess) and I'm wondering if there is a (simple)
There has to be something utterly simple I'm overlooking here, but for the life
This is obviously a topic that has been discussed many times, however my angle
I have a simple JavaScript file that has three jQuery $document.ready functions. All three
I'm building a simple code-first MVC 3 blog like application. My model has three

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.