Clojure project layout and relative imports -


i'm having hard time starting out on first clojure project. have found ton of tutorials , answers questions, none of seems answer problem.

i have created blank project using leiningen. example explains problem:

project.clj:

(defproject clojurenet "0.1.0-snapshot"   :description "fixme: write description"   :url "http://example.com/fixme"   :license {:name "eclipse public license"             :url "http://www.eclipse.org/legal/epl-v10.html"}   :dependencies [ [org.clojure/clojure "1.6.0"]                   [net.mikera/core.matrix "0.34.0"]                   [org.clojure/math.numeric-tower "0.0.1"]]   :main ^:skip-aot clojurenet.core   :target-path "target/%s"   :profiles {:uberjar {:aot :all}}) 

src/clojurenet/core.clj:

(ns clojurenet.core)   (:require clojurenet.hello)   (:gen-class))  (defn -main   [& args]   (clojurenet.hello/helloworld) 

src/clojurenet/hello.clj:

(ns clojurenet.hello)  (defn helloworld []     (println "hello world!")) 

when run lein run error message exception in thread "main" java.lang.classnotfoundexception: clojurenet.hello, compiling:(clojurenet/core.clj:2:3). how supposed this?

i rather use :refer :all syntax in core file, belive example should simplest.

i'm sure there stupid simple solution this, research has not been successful.

additionally, have som tutorials building first project? find tutorials outdated, , of describes how use repl.

thanks in advance!

you have unbalanced parantheses in clojurenet.core

(ns clojurenet.core) ;; <- remove ) fix   (:require clojurenet.hello)   (:gen-class)) 

i recommend using balancing editing mode paredit. may want try out this implementation if using sublime.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -