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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:06:57+00:00 2026-05-29T21:06:57+00:00

I have a simple structure like this: (def example {:bbb bbb :xxx [1 2

  • 0

I have a simple structure like this:

(def example {:bbb "bbb" :xxx [1 2 3] :yyy '(3 5 7)})

If I write this out to a file it contains

{:bbb "bbb" :xxx [1 2 3] :yyy (3 5 7)}

Which is mostly correct, but if I load-file on this, it fails because it tries to treat 3 as a function (the parens are no longer quoted, so tries to evaluate as a function).

What is the right way to do this? Thanks!

  • 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-29T21:06:58+00:00Added an answer on May 29, 2026 at 9:06 pm

    If you want to read back a Clojure datum previously written to a file as a literal, you need to use read or read-string rather than load-file:

    (with-open [fd (java.io.PushbackReader.
                    (io/reader (io/file "/path/to/file")))]
      (read fd))
    

    You can call read multiple times to read successive forms (as long as you hold the Reader open, of course).

    This involves no evaluation except when the #= reader macro occurs in the input stream, in which case the form immediately following it is evaluated at read time and replaced with the result in read‘s output (e.g. (read-string "#=(+ 1 2)") returns 3). To prohibit evaluation of #= prefixed forms bind *read-eval* to false.

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

Sidebar

Related Questions

Assuming I have a simple structure that looks like this: public class Range {
I have a simple table structure like this. What I would like to do
I have a simple tree structure represented like this: Node { int Id; int
I have a simple database structure like this: entries table +----+-----------+------------+-----------+------+ | id |
I have a simple one-to-many structure like this: class User(db.Model): userEmail = db.StringProperty() class
I have a simple XML structure like, that when parse with simplexml_load_string generates this:
I have a very simple binary tree structure, something like: struct nmbintree_s { unsigned
I have a large xml file (approx. 10 MB) in following simple structure: <Errors>
I have a simple jquery/ajax request to the server which returns the structure and
Hi I have a list of lists structure like this udbList=[ [132, 2011-11-28 00:00:00.0,

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.