Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; ---------- FILE my-config.dat:
- (def config-map
- {
- :line-num-fmt "%d" ; Java printf format.
- :prompt-char \> ; Single character.
- :data-sources
- {
- "some-db" { :host "some-hostname"
- :port 1521
- :sid "some-SID"
- :user "some-user"
- :pass "some-password" }
- "another-db" { :host "127.0.0.1"
- :port 1523
- :sid "HR"
- :user "username"
- :pass "password" }
- }})
- ;; ---------- FILE myapp.clj:
- (let [conf-file (nth *command-line-args* 0)
- db-name (.trim (nth *command-line-args* 1))]
- (load-file conf-file)
- config-map)
- ;; ---------- ISSUE:
- Then I run as:
- $ java -cp clojure.jar clojure.main myapp.clj my-config.dat some-db
- I expect to see the config-map map since it was the last thing evaluation, but I am getting "Unable to resolve symbol: config-map in this context". If I enter the repl using "java -jar clojure.jar" and then do (load-file "my-config.dat") and the type config-map the map is printed as expected.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement