English 中文(简体)
Clojure: reload from thestring
原标题:Clojure: reload from string
  • 时间:2012-05-15 09:33:55
  •  标签:
  • clojure

EDIT: is what I want basically load-string?

Question

在衣着,如果我这样做的话:

(require :reload  foo.bar)

然后,Clojure处理rc/foo/bar.clj,并重载。

我现在想做这样的事情:

(reload-from-string  foo.bar STR)

the semantics of this would be: reload namespace foo.bar, but instead of compiling src/foo/bar.clj, compile STR instead.

我如何界定从重载后重载?

Context

I need to hot reload code on a server that is running an Clojure application. I don t want to have to continuously shuffle files back & forth to the server (either via scp, sftp, or fuse/sshfs) in order to reload. Thus, I would prefer to just pass it a string.

感谢!

最佳回答

您可使用<条码>,可在<条码>上载<>,然后使用<条码>。 但铭记风险。 分割这些清单的好处是,在撤销清单之前,你可以把清单中的内容区分开来。

你可能要把<条码>* 阅读-eval*也装上错误。

问题回答

暂无回答




相关问题
How to improve Clojures error messages

I ve been playing a bit with Clojure and so far is fairly impressed, but one thing that I keep running into is wierd error messages from Clojure. This comes in two forms: Java errors, like null ...

clojure rmi classpath problem

I am trying to use clojure to implement a "plugin" for some vendor supplied software. Here is a little background on the vendor supplied software. It expects me to implement a particular interface ...

Help translating this Java codeblock to Clojure?

I m getting my feet wet with Clojure, and trying to get used to functional programming. I ve been translating various imperative functions from other languages into their Clojure equivalents -- and ...

Is functional Clojure or imperative Groovy more readable?

OK, no cheating now. No, really, take a minute or two and try this out. What does "positions" do? Edit: simplified according to cgrand s suggestion. (defn redux [[current next] flag] [(if flag ...

taking java method names as function arg in clojure

All, I want to create a function that takes a symbol representing a java method and applies it to some object: (user=> (defn f [m] (. "foo" (m))) When I execute this, I get a result much ...

how to efficiently apply a medium-weight function in parallel

I m looking to map a modestly-expensive function onto a large lazy seq in parallel. pmap is great but i m loosing to much to context switching. I think I need to increase the size of the chunk of work ...

热门标签