{"action":"created","issue":{"url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/309","repository_url":"https://api.github.com/repos/clojure-emacs/cider-nrepl","labels_url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/309/comments","events_url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/309/events","html_url":"https://github.com/clojure-emacs/cider-nrepl/issues/309","id":138388542,"number":309,"title":"Can't Use Alembic's load-project due to error compiling print_method.clj (it references clojure.core/deref-as-map)","user":{"login":"twashing","id":239784,"avatar_url":"https://avatars.githubusercontent.com/u/239784?v=3","gravatar_id":"","url":"https://api.github.com/users/twashing","html_url":"https://github.com/twashing","followers_url":"https://api.github.com/users/twashing/followers","following_url":"https://api.github.com/users/twashing/following{/other_user}","gists_url":"https://api.github.com/users/twashing/gists{/gist_id}","starred_url":"https://api.github.com/users/twashing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twashing/subscriptions","organizations_url":"https://api.github.com/users/twashing/orgs","repos_url":"https://api.github.com/users/twashing/repos","events_url":"https://api.github.com/users/twashing/events{/privacy}","received_events_url":"https://api.github.com/users/twashing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-04T06:11:54Z","updated_at":"2016-03-04T13:16:19Z","closed_at":null,"body":"## Expected behavior\r\n\r\nAdding alembic \"0.3.2\" to my project should let me reload a project by calling `load-project`.\r\n\r\n## Actual behavior\r\n\r\n```\r\n$ lein repl\r\nnREPL server started on port 53138 on host 127.0.0.1 - nrepl://127.0.0.1:53138\r\nREPL-y 0.3.7, nREPL 0.2.10\r\nClojure 1.8.0\r\nJava HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02\r\n...\r\nuser=> (./load-project)\r\n               alembic.still/load-project*      still.clj:  290\r\n                                       ...                     \r\n   leiningen.core.project/apply-middleware    project.clj:  742\r\n                                       ...                     \r\n                         clojure.core/load       core.clj: 5640\r\n                      clojure.core/load/fn       core.clj: 5641\r\n                                       ...                     \r\n                 java.lang.RuntimeException: Unable to resolve var: clojure.core/deref-as-map in this context\r\n    clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve var: clojure.core/deref-as-map in this context, compiling:(cider/nrepl/print_method.clj:87:13)\r\njava.lang.reflect.InvocationTargetException:\r\n```\r\n## Steps to reproduce the problem\r\n\r\n1. run `lein new thing` (then cd to thing/)\r\n2. add **[alembic \"0.3.2\"]** and **[fipp \"0.6.4\"]** to the project's dependencies\r\n3. run `lein repl` to get a repl\r\n4. in your repl evaluate `(require '[alembic.still])`\r\n5. in your repl evaluate `(alembic.still/load-project)`\r\n\r\n```\r\n(defproject thing \"0.1.0-SNAPSHOT\"\r\n  :dependencies [[org.clojure/clojure \"1.8.0\"]\r\n                           [fipp \"0.6.4\"]\r\n                           [alembic \"0.3.2\"]])\r\n```\r\n\r\n## Environment & Version information\r\n\r\n```\r\n$ lein repl\r\nnREPL server started on port 53138 on host 127.0.0.1 - nrepl://127.0.0.1:53138\r\nREPL-y 0.3.7, nREPL 0.2.10\r\nClojure 1.8.0\r\nJava HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02\r\n```\r\n\r\n### cider-nrepl version\r\n\r\n[cider/cider-nrepl \"0.12.0-snapshot\"]\r\n\r\n### Java version\r\n\r\nJava HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02\r\n\r\n### Operating system\r\n\r\nOSX 10.11.3\r\n"},"comment":{"url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/comments/192280441","html_url":"https://github.com/clojure-emacs/cider-nrepl/issues/309#issuecomment-192280441","issue_url":"https://api.github.com/repos/clojure-emacs/cider-nrepl/issues/309","id":192280441,"user":{"login":"Malabarba","id":453029,"avatar_url":"https://avatars.githubusercontent.com/u/453029?v=3","gravatar_id":"","url":"https://api.github.com/users/Malabarba","html_url":"https://github.com/Malabarba","followers_url":"https://api.github.com/users/Malabarba/followers","following_url":"https://api.github.com/users/Malabarba/following{/other_user}","gists_url":"https://api.github.com/users/Malabarba/gists{/gist_id}","starred_url":"https://api.github.com/users/Malabarba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Malabarba/subscriptions","organizations_url":"https://api.github.com/users/Malabarba/orgs","repos_url":"https://api.github.com/users/Malabarba/repos","events_url":"https://api.github.com/users/Malabarba/events{/privacy}","received_events_url":"https://api.github.com/users/Malabarba/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T13:16:19Z","updated_at":"2016-03-04T13:16:19Z","body":"Looks like this is due to the following snippet, at the end of print_method.clj:\r\n\r\n    (when (resolve 'clojure.core/deref-as-map)\r\n      (def-print-method clojure.lang.IDeref c\r\n        \"#\" (deref-name c) \"[\"\r\n        (pr-str (#'clojure.core/deref-as-map c))\r\n        (format \" 0x%x]\" (System/identityHashCode c))))\r\n\r\nNow I realise that this code does not do what it's supposed to. I will change it to the following:\r\n\r\n    (when-let [f (resolve 'clojure.core/deref-as-map)]\r\n      (def-print-method clojure.lang.IDeref c\r\n        \"#\" (deref-name c) \"[\"\r\n        (pr-str (f c))\r\n        (format \" 0x%x]\" (System/identityHashCode c))))\r\n\r\nHowever, that still doesn't answer the question of why the problem comes up for you with Alembic. If this function was defined for you when you started the REPL, why is it suddenly gone when you reload with Alembic?\r\nCould it be a bug in Alembic due to the fact that the function is private?"}}