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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:33:51+00:00 2026-06-02T04:33:51+00:00

When I run a 221 line .csv file — parsed with clojure-csv — into

  • 0

When I run a 221 line .csv file — parsed with clojure-csv — into this function

(defn test-key-inclusion
    "Accepts csv-data param and an index, a second csv-data param and an index,
     and searches the second csv-data instances' rows (at index) to see if
     the first file's data is located in the second csv-data instance."

    [csv-data1 pkey-idx1 csv-data2 pkey-idx2 lnam-idx fnam-idx]

    (reduce
        (fn [out-log csv-row1]
            (let [cmp-val (nth csv-row1 pkey-idx1 nil)
                  lnam (nth csv-row1 lnam-idx nil)
                  fnam (nth csv-row1 fnam-idx)
                  temp-rc (first (key-pres? cmp-val pkey-idx2 csv-data2))]

            (concat out-log (sorted-map cmp-val (vector lnam fnam)))))
         {}
         csv-data1))

and then print the result, everything’s fine.

If I run a 2672 line .csv file — also parsed with clojure-csv — through the function above and then try to print it, I get a stack overflow error — Exception in thread “main” java.lang.StackOverflowError

So my questions are:

1) Should wrapping the call to this function inside lazy-seq cure my problem?

2) I don’t want a list, so will wrapping the lazy-seq call inside a vec turn
my sequence back into a vector without realizing the whole sequence in memory, that is make the lazy-seq un-lazy again?

Thank you.

  • 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-02T04:33:52+00:00Added an answer on June 2, 2026 at 4:33 am

    1) i expect that making the sequence lazy not to help because print will evaluate realize it before printing it. instead try doseq or (map print my-seq) to print it in smaller chunks.

    2) yes wrapping it in vec will give you what you want 🙂 though wrapping your reduce with an into would keep it a vector the whole time. ie: (reduce into [] [[1] [2] [3]] ) –> [1 2 3]

      (into out-log (sorted-map cmp-val (vector lnam fnam)))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To run Clojure files from command line, I'm using a zhs alias I added
I run several queries from mysql command line on my linux box (Fedora Os).
I run into follow problem. Did I miss anything? Association.all().count() 1 Association.all().fetch(1) [Association(**{'server_url': u'server-url',
I run the following Gert's extract command to the data dump file which format
Attempting to run a MIB based SNMP script and I running into an issue.
I'd like to request some help in creating a Batch file to run on
New to Tsung and Erlan and have run into an issue I haven't been
run([H|T]) --> num(H),run(T). run([T]) --> num(T). num(increase) --> [increase],{write(1),nl}. num(decrease) --> [decrease],{write(0),nl}. In this
run(/test.js) in mongo shell. i always get error run(/test.js) shell: started program /test.js sh2516|
When I run even a sample test, either in Netbeans IDE of from the

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.