문제

In clojure I have lines like this that define default values:

(def *http-port* 8080)

I've now decided to formalize these kinds of values into a configuration unit and I would like to undefine the value *http-port* so that I can find the locations that still refer to this value and change them to use the new value. I'm doing a refactoring in other words by moving the value to a different location.

The way I've been doing this is to quit slime and try to restart the slime session. During maven's compile phase errors like these are picked up and I can find and fix one reference at a time. I then fix the error, wash rinse and repeat. This is obviously frustrating.

How would I do this while connected to a slime session?

도움이 되었습니까?

해결책

If I understand you correctly, ns-unmap should do what you want:

user=> foo
java.lang.Exception: Unable to resolve symbol: foo in this context (NO_SOURCE_FILE:1)
user=> (def foo 1)
#'user/foo
user=> foo
1
user=> (ns-unmap (find-ns 'user) 'foo)
nil
user=> foo
java.lang.Exception: Unable to resolve symbol: foo in this context (NO_SOURCE_FILE:1)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top