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

The Archive Base Latest Questions

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

Since Clojure 1.3, I am confused about the directory structure needed to build something

  • 0

Since Clojure 1.3, I am confused about the directory structure needed to build something in Clojure. I am using cake to build and cake repl.

Here is what works. I have a working build directory addr_verify. The main’s and ns’s name is addr-verify. The project.clj refers to addr-verify as main, and in addr_verify/src there is addr_verify.clj. The ns inside addr_verify.clj refers to the addr-verify name space.

Now, I had a directory mr1, but cake won’t compile it right at line 1

(ns mr1
  (use ['clojure.string :only '(split)])
  (use ['clojure.string :only '(join)])
  )

If mr1 is a bad name, what naming convention should I use?

I have tried mr1_app as a directory structure using mr1-app as the main name and ns name. I

For mr1 as the directory and ns name, I get

Caused by: clojure.lang.Compiler$CompilerException: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.Comparable, compiling:(mr1.clj:1)

I’m just not getting what I’m doing wrong here, and I know it’s probably something really simple.

Edit:

Why does the binary mr1 not have a main?

mr1/project.clj

(defproject mr1 "0.0.1-SNAPSHOT"
  :description "TODO: add summary of your project"
  :dependencies [[org.clojure/clojure "1.3.0"]
                 [org.clojure/tools.cli "0.1.0"]]
   :main mr1)

mr1/src/mr1.clj

(ns mr1
    (:use [clojure.string :only [split]]
          [clojure.string :only [join]]))

(def grid-dim (atom '(0 0)))
(def mr1-pos (atom '(0 0)))
(def mr2-pos (atom '(0 0)))

(defn cvt-str-to-int
    [string]
   (map #(Integer/parseInt %)
    (split string #" ")))

(defn prompt-for-grid-dim
    []
    (do
        (println "Enter the dimensions of the grid (10 10) ")
        (cvt-str-to-int (read-line))
    ))

(defn prompt-for-rover-pos
    [rover-num]
    (do
        (println "Enter rover's initial position on the grid (2 4) ")
        (cvt-str-to-int (read-line))
    ))

(defn prompt-for-rover-moves
    []
    (do
        (println "Enter rover's moves LMMRM ")
        (read-line)
    ))

(defn -main 
    [& args]
    (do
       (reset! grid-dim (cvt-str-to-int (prompt-for-grid-dim)))
       (reset! mr1-pos (cvt-str-to-int (prompt-for-rover-pos)))
    ) 
)
  • 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:05:53+00:00Added an answer on May 27, 2026 at 9:05 am

    I think there is something wrong with the “syntax” of your namespace declaration. Instead, try this:

    (ns mr1
        (:use [clojure.string :only [split]]
              [clojure.string :only [join]]))
    

    Change your :main setting in project.clj accordingly: it should just be mr1, contrary to what I said earlier.

    Edited according the comment of googolplex

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

Sidebar

Related Questions

I have been using ClojureScript on Windows since it first came out and I
compiling clojure files generate .class files in classes directory . Since classes direct is
I am considering writing a REST Server using Clojure. I have experience using RESTEasy
Since CS3 doesn't have a web service component, as previous versions had, is there
I wrote a Clojure project using Leiningen and would now like to add the
I seem to be doing something wrong. I've built clojure from git, and am
I have an arbitrary number of lists which I would like to process using
Since Clojure 1.3 Earmuffed Vars are No Longer Automatically Considered Dynamic, some code in
I am writing a Clojure macro that accepts a description of a panel using
I have a dummy Java Program, which I want to write in Clojure. It

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.