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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:51:36+00:00 2026-05-13T14:51:36+00:00

How can I take a large existing Java project and start to add Clojure

  • 0

How can I take a large existing Java project and start to add Clojure modules? For example, in the code below, I’d like to make the following functions available in Java: state?, zip?, state-list, zipcode-list. The two predicates will return a boolean, but the “getters” will return arrays.

(def *states* (list "NJ" "NY" "CA"))
(def *zipcodes*  (list 12345 54343 98765))

(defn member [x sq]
  (if (seq sq)
    (if (= x (first sq))
      sq
      (recur x (rest sq)))))

(defn state? [aState]
  (not (= (member aState *states*) nil)))

(defn zip? [aZip]
  (not (= (member aZip *zipcodes*) nil)))

(defn state-list []
  *states*)

(defn zipcode-list []
  *zipcodes*)
;; ---------------
(state? "AA")
(state? "CA")
(zip? 11111)
(zip? 12345)
  • 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-13T14:51:37+00:00Added an answer on May 13, 2026 at 2:51 pm

    I would compile it using leiningen then add the jar file to my java project as a build dep. Here is a great video on using leiningen.
    then you would call it directly from java. Leiningen has an uberjar option that bulds in clojure and all your clojure dependencies so you only have to worry about one file. I like this because its less work.

    A more java friendly approach would be to add an ant task to build it along with the java project its just a little more work

    for the functions that need to return proper java arrays call to-array on them

    contrary to many of the top “calling clojure from java” hits you should not need to call the clojure runtime RT.

    PS: my favorite tag line “I would like to use a java library called clojure” I asked Rich he said this was cool 😉

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

Sidebar

Ask A Question

Stats

  • Questions 313k
  • Answers 313k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The details you need are in Intel® 64 and IA-32… May 13, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer Please see Chapter 8 for polymorphic mapping rules with NHibernate.… May 13, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer As of 2013, Chrome supports the window.onerror. (I have version… May 13, 2026 at 10:47 pm

Related Questions

I am attempting to write (or expand on an existing) graph search algorithm that
I'm keen to drink some modern dynamic language koolaid, so I've believed all the
This is odd, but we have written an asp.Net web application (all's well there)
I work in a medium sized team and I run into these painfully large
I recently found and fixed a bug in a site I was working on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.