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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:06:12+00:00 2026-05-20T14:06:12+00:00

Noob question, using Win7 64-bit, Clojure 1.2.0, Java 1.6.0_22 When I start clojure from

  • 0

Noob question, using Win7 64-bit, Clojure 1.2.0, Java 1.6.0_22

When I start clojure from command line, pprint function is easily available.

user=> pprint
#<pprint$pprint clojure.pprint$pprint@16dfa45>
user=> (pprint "hi")
"hi"
nil
user=>

But when I try to use pprint from a file, I get an error. This happens with and without namespace (ns… :require…) as shown in pprint documentation

clj file as follows:

(ns whatevah
(:require clojure.pprint))

(pprint "hi")

Error as follows:

C:\Users\mischw\code\Clojure>java -cp ";c:\users\mischw\code\clojure\classes\*;c:\Program Files (x86)\Java\SWT;c:\users\mischw\code\clojure\classes\bookcode\*" clojure.main swinglearn.clj 
Exception in thread "main" java.lang.Exception: Unable to resolve symbol: pprint in this context (swinglearn.clj:14)
... 21 more

Output completed (0 sec consumed) - Normal Termination

I don’t understand the general idea of what’s going on here. Why does one work but not the other? Does that have to do with namespaces? Classpaths? Some other simple fix? Clearly noob questions, but I find this happens with a bunch of examples… I’m unable to run them even though it seems straightforward to import/use/require/include them.

  • 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-20T14:06:13+00:00Added an answer on May 20, 2026 at 2:06 pm

    You’re getting require mixed up with use and/or import. require causes the library to get loaded, and every public symbol it exports will be accessible as eg clojure.pprint/pprint. If you want to use a more convenient name like just pprint, you need to refer to the namespace. use is a convenient shorthand for “require, then refer”, to load the library without the namespace prefix.

    user> (ns user (:require clojure.pprint))
    nil
    user> (pprint 1)
    ; Evaluation aborted.
    user> (clojure.pprint/pprint 1)
    1
    nil
    user> (ns user (:use clojure.pprint))
    nil
    user> (pprint 1)
    1
    

    Edit: Not sure why it’s working for you from the REPL. As you can see, it doesn’t work for me. I imagine you did some setup earlier that makes it work and then forgot about it, or possibly you have some init script that does this stuff for you at the REPL but not when loading from a file.

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

Sidebar

Related Questions

I know this may be a noob question, but it's bugging the heck out
First of all, I am a complete Java NOOB. I want to handle multiple
This is going to be the noobist of all noob questions, but what exactly
I am a noob when it comes to python. I have a python script
I'm a complete Flex noob, so I apologize in advance if I'm missing something

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.