开发者

Setting a project property to a non literal string appears to not work in leiningen

开发者 https://www.devze.com 2023-04-12 16:55 出处:网络
Take a simple project file: (defproject sample-clojure-cloudbees \"1.0.0-SNAPSHOT\" :description \"Sample clojure application - clojure 1.3 !\"

Take a simple project file:

(defproject sample-clojure-cloudbees "1.0.0-SNAPSHOT" :description "Sample clojure application - clojure 1.3 !" :blah "hello")

When I read (get project :blah) I get "hello" string returned - as expected.

If I replace "hello"

:blah (slurp "some file...")

I get an error, Caused by: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to java.lang.String

It seems to not be evaluatin开发者_JS百科g things how I expect, any ideas?


defproject is a macro it won't evaluate (slurp...) unless you tell it to,

replacing,

:blah (slurp "some file...")

with,

:blah ~(slurp "some file...")

will give you the content of the file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号