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

  • Home
  • SEARCH
  • 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 8690665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:57:03+00:00 2026-06-12T23:57:03+00:00

My application runs when I run it in the clojure repl or using leiningen

  • 0

My application runs when I run it in the clojure repl or using leiningen repl but when i create a jar using uberjar and run the application it only reads the first 2 records of my collection.

I tracked it down to pmap so I created the simplest possible use of pmap and it gets wierder.
why does this work

(ns ktest.core
    (:gen-class))
(defn -main []
  (println (pmap identity (range 20))))

but not this

(ns ktest.core
        (:gen-class))
    (defn -main []
       (pmap #(println %) (range 20)))
  • 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-06-12T23:57:04+00:00Added an answer on June 12, 2026 at 11:57 pm

    you have been bitten by “the lazy bug”. pmap creates the sequence that when read will compute the results. when you run this with the println it reads the results so it can print them, thus triggering the evaluation. In this case you can fix this will doall or dorun. If you only need the printing side effects of running it then choose dorun, if you need to do something with this result then choose doall which keeps the results in memory.

    (dorun (pmap #(println %) (range 20)))
    

    a couple items get printed because of chunked sequences. see this Jira issue for details on pmap and chunked sequences.

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

Sidebar

Related Questions

My application runs well on emulator but when I run on device it gives
The application which runs smoothly on 4.0.1 when was tried on run on 4.2.1
I have developed a java application which run's perfectly in local server. But When
I have a ASP.NET MVC application using NHibernate and the application runs fine when
I recently upgraded from Grails 1.3.7 to Grails 2.0.1. The application runs normal, but
I have a application that runs very well on JBoss using JSF 2. I
If my application runs out of memory, I would like to re-run it with
My web application runs on Windows. I would like to run my app on
My Spring application runs on Tomcat 6.0 on localhost. When I try to run
I am using a third party database. A host application runs the database, and

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.