Advertisement
Guest User

cls-issue-201207150130

a guest
Jul 15th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; ---------- FILE my-config.dat:
  2. (def config-map
  3.   {
  4.    :line-num-fmt "%d" ; Java printf format.
  5.    :prompt-char  \>   ; Single character.
  6.    :data-sources
  7.    {
  8.     "some-db" { :host "some-hostname"
  9.                 :port 1521
  10.                 :sid  "some-SID"
  11.                 :user "some-user"
  12.                 :pass "some-password" }
  13.     "another-db" { :host "127.0.0.1"
  14.                    :port 1523
  15.                    :sid  "HR"
  16.                    :user "username"
  17.                    :pass "password" }
  18.     }})
  19.  
  20. ;; ---------- FILE myapp.clj:
  21. (let [conf-file (nth *command-line-args* 0)
  22.       db-name   (.trim (nth *command-line-args* 1))]
  23.   (load-file conf-file)
  24.   config-map)
  25.  
  26. ;; ---------- ISSUE:
  27. Then I run as:
  28. $ java -cp clojure.jar clojure.main myapp.clj my-config.dat some-db
  29. 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