Simbi
Simbi

Reputation: 1042

Leiningen classpath issues, adding a second file to project

I'm currently trying to add a second file to my first leiningen project.

In pro/core.clj

(ns pro.core
  (:gen-class)
  (:require ([pro.protocols :as prtcl])))

(extend-protocol prtcl.Matrix
...

In pro/protocols.clj

(ns pro.protocols)
(defprotocol Matrix
    "Protocol for working with 2d datastructures."
    (lookup [matrix i j])
    (update [matrix i j value])
    (rows [matrix])
    (cols [matrix])
    (dims [matrix]))

When running lein compile I keep getting:

Exception in thread "main" java.lang.ClassNotFoundException: prtcl.Matrix, compiling:(pro/core.clj:8)

Thank you!

Upvotes: 2

Views: 110

Answers (2)

Simbi
Simbi

Reputation: 1042

In addition to Diego's answer, I hat to rewrite

(:require ([pro.protocols :as prtcl]))

to

(:require [pro.protocols :as prtcl])

Upvotes: 0

Diego Basch
Diego Basch

Reputation: 13079

You want prtcl/Matrix, not prtcl.Matrix.

Upvotes: 2

Related Questions