3

Im working on compiling jars from a local repository in leiningen. This works in my project.clj:

:repositories {"local" ~(str (.toURI (java.io.File. "local_mvn_repo")))} 

but this fails:

:repositories [["local" (str (.toURI (java.io.File. "local_mvn_repo")))]] $ lein deps java.lang.UnsupportedOperationException: nth not supported on this type: Symbol 

Even though the latter looks in compliance with the official example. My question is this:

What does the ~ do above, which do I need it, and why can't i use the vector form?

1 Answer 1

3

The ~ is the unquoting function in this case, it tells lieningen to run the form after it and use the value produced by running it instead of trying to use it directly.

The first example if the format for Leiningen version 1.x while the second from is the newer form and is failing because it is missing the ~ and some { }

:repositories [["local" {:url ~(str (.toURI (java.io.File. "local_mvn_repo")))}]] 

ps: I'm not sure if the map form is required and I'm assuming you are using lein2

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.