0

I have two separate Leiningen projects on my PC (the result of running lein new alpha and lein new beta on the same directory). In addition to the usual core.clj file, the alpha project contains also a file called src/alpha/utils.clj with a function called plus.

Calling plus from it sibling file core.clj is no problem:

;  src/alpha/core.clj

(ns alpha.core
  (:require [alpha.utils :as u]))

(u/plus 2 3)
;; 5

The question is: How do I call that plus function from the beta project; esp.from src/beta/core.clj?

I found a similar-sounding question here on StackOverflow but that is about calling a function stored in a separate file in the same project (the cooperating namespaces (foo.bar and foo.quux.baz) have the same prefix).

Jorge D
  • 41
  • 7

1 Answers1

0

As indicated by @possum, the solution is to create a symbolic link in a top-level subdirectory called checkouts in the beta project ("the client"). Here are the commands for MS Windows:

mkdir \path\to\beta\checkouts
cd \path\to\beta\checkouts
mklink /D alpha \path\to\alpha

Now it is possible to start the REPL on beta and run (require '[alpha.utils :as u])

Jorge D
  • 41
  • 7