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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:49:03+00:00 2026-05-27T09:49:03+00:00

I am at the REPL, and I create a java array: => (def arr

  • 0

I am at the REPL, and I create a java array:

=> (def arr (double-array [1 2 3]))

Of course, if I want to look at my arr, I get:

=> arr
#<double[] [D@2ce628d8>

Is there anything I can do that will make arrays of java primitives print like clojure’s persistentVectors?

=> arr
[1.0 2.0 3.0]

I know I could wrap my arrays in some sort of nice printing function (which is what I currently do), but this is a pain in cases, for example, where the vectors are part of a map:

=> my-map
{"1" #<double[] [D@47254e47>, "2" #<double[] [D@11d2625d>}
  • 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-27T09:49:04+00:00Added an answer on May 27, 2026 at 9:49 am

    Would something as simple as the following do?

    user=> (seq arr)
    (1.0 2.0 3.0)
    

    If it’s only for the REPL, then perhaps the technical semantics don’t matter.

    Update

    It turns out that pretty print (pprint) works just fine with your map of vectors:

    user=> (def my-map {"1" (double-array [1 2 3])
                        "2" (double-array [1 2 3])})
    #'user/my-map
    user=> (pprint my-map)
    {"1" [1.0, 2.0, 3.0], "2" [1.0, 2.0, 3.0]}
    

    Final Update: From the linked Google Groups discussion in the comments

    Questioner found an answer he liked in a discussion paraphrased below:

    > Is there any way to make the Clojure repl pretty-print by default?

    Try:

    (clojure.main/repl :print pprint)

    > Thank you! That is exactly what I needed.

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

Sidebar

Related Questions

Is there something like python's interactive REPL mode, but for Java? So that I
Possible Duplicate: Java REPL shell Hey, Is there any way to execute Java code
If at the REPL I enter: (type-of (make-array 5)) then I get the response:
On REPL, if I define (def fits (map vector (take 10 (iterate inc 0))))
Is there a REPL (Read-Eval-Print Loop) available anywhere for Actionscript 3? I could not
Using Scala's command line REPL: def foo(x: Int): Unit = {} def foo(x: String):
I'd like to get a colored REPL for clojure code, similar to what you
I'm writing a toy interpreter with a REPL in Java. I'd like to generate
simple REPL test... def g(a:Int)(implicit b:Int) = {a+b} Why do neither of these attempted
I've been using Clojure for a little while and want to create some projects

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.