{"action":"created","issue":{"url":"https://api.github.com/repos/Lambda-X/replumb/issues/170","repository_url":"https://api.github.com/repos/Lambda-X/replumb","labels_url":"https://api.github.com/repos/Lambda-X/replumb/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/Lambda-X/replumb/issues/170/comments","events_url":"https://api.github.com/repos/Lambda-X/replumb/issues/170/events","html_url":"https://github.com/Lambda-X/replumb/issues/170","id":144697435,"number":170,"title":"replumb/read-eval-call doesn't support `:refer`","user":{"login":"viebel","id":955710,"avatar_url":"https://avatars.githubusercontent.com/u/955710?v=3","gravatar_id":"","url":"https://api.github.com/users/viebel","html_url":"https://github.com/viebel","followers_url":"https://api.github.com/users/viebel/followers","following_url":"https://api.github.com/users/viebel/following{/other_user}","gists_url":"https://api.github.com/users/viebel/gists{/gist_id}","starred_url":"https://api.github.com/users/viebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viebel/subscriptions","organizations_url":"https://api.github.com/users/viebel/orgs","repos_url":"https://api.github.com/users/viebel/repos","events_url":"https://api.github.com/users/viebel/events{/privacy}","received_events_url":"https://api.github.com/users/viebel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-03-30T19:33:19Z","updated_at":"2016-04-04T20:33:39Z","closed_at":null,"body":"\r\nWhen calling `replumb/read-eval-call` with `:refer` inside the source, it doesn't work.\r\n\r\nFor instance,\r\n\r\n\r\n```clojure\r\n(defn no-op [file-url src-cb]\r\n  (src-cb \"\"))\r\n\r\n(def repl-opts-noop (merge (replumb/options :browser\r\n                                             [\"/dbg/js\" \"/js/compiled/out\"]\r\n                                             io/no-op)\r\n                            {:warning-as-error false\r\n                             :context :statement\r\n                             :verbose false}))\r\n(replumb/read-eval-call repl-opts-noop identity \"(ns my.aa (:require [clojure.set :refer [union]]) )\")\r\n\r\n; => {:success? false, :form (ns my.aa (:require [clojure.set :refer [union]])), :warning nil, :error #error {:message \"Could not parse ns form my.aa\", :data {:tag :cljs/analysis-error}, :cause #error {:message \"Invalid :refer, var var clojure.set/union does not exist\", :data {:tag :cljs/analysis-error}}}}\r\n\r\n```\r\n\r\nWhile it works fine with `:as`\r\n\r\n```clojure\r\n\r\n(replumb/read-eval-call repl-opts-noop identity \"(ns my.aa (:require [clojure.set :as set])) (set/union)\")\r\n; => {:success? true, :form (ns my.aa (:require [clojure.set :as set])), :warning nil, :value \"#{}\"}\r\n\r\n``` "},"comment":{"url":"https://api.github.com/repos/Lambda-X/replumb/issues/comments/205481955","html_url":"https://github.com/Lambda-X/replumb/issues/170#issuecomment-205481955","issue_url":"https://api.github.com/repos/Lambda-X/replumb/issues/170","id":205481955,"user":{"login":"viebel","id":955710,"avatar_url":"https://avatars.githubusercontent.com/u/955710?v=3","gravatar_id":"","url":"https://api.github.com/users/viebel","html_url":"https://github.com/viebel","followers_url":"https://api.github.com/users/viebel/followers","following_url":"https://api.github.com/users/viebel/following{/other_user}","gists_url":"https://api.github.com/users/viebel/gists{/gist_id}","starred_url":"https://api.github.com/users/viebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viebel/subscriptions","organizations_url":"https://api.github.com/users/viebel/orgs","repos_url":"https://api.github.com/users/viebel/repos","events_url":"https://api.github.com/users/viebel/events{/privacy}","received_events_url":"https://api.github.com/users/viebel/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T20:33:39Z","updated_at":"2016-04-04T20:33:39Z","body":"\r\nI'm not yet able to make it work.\r\nI have tried the following\r\n```clojure\r\n(defn no-op [file-url src-cb]\r\n  (src-cb \"\"))\r\n(def repl-opts-noop (merge (replumb/options :browser\r\n                                             [\"/dbg/js\" \"/js/compiled/out\"]\r\n                                             no-op)\r\n                            {:warning-as-error false\r\n                             :context :statement\r\n                             :cache {:src-paths-lookup? true}\r\n                             :verbose false}))\r\n(replumb/read-eval-call (merge repl-opts-noop {:verbose true}) identity \"(ns my.aa (:require [clojure.set :as set :refer [union]])) (union)\")\r\n```\r\n\r\nAnd I get this log\r\n```clojure\r\nCalling eval-str on (ns my.aa (:require [clojure.set :as set :refer [union]])) with options {:read-file-fn! <hidden function>, :init-fns <hid\r\nden function>, :write-file-fn! <hidden function>, :verbose true, :cache {:src-paths-lookup? true}, :warning-as-error false, :context :stateme\r\nnt, :load-fn! <hidden function>, :target :default, :src-paths [/dbg/js /js/compiled/out]}\r\nEvaluation returned:  {:error #error {:message Could not parse ns form my.aa, :data {:tag :cljs/analysis-error}, :cause #error {:message Inva\r\nlid :refer, var var clojure.set/union does not exist, :data {:tag :cljs/analysis-error}}}}\r\nCalling eval-str on (ns my.aa (:require [clojure.set :as set :refer [union]])) with options {:read-file-fn! <hidden function>, :init-fns <hid\r\nden function>, :write-file-fn! <hidden function>, :verbose true, :warning-as-error false, :context :statement, :load-fn! <hidden function>, :\r\ntarget :default, :src-paths [/dbg/js /js/compiled/out]}\r\nEvaluation returned:  {:error #error {:message Could not parse ns form my.aa, :data {:tag :cljs/analysis-error}, :cause #error {:message Inva\r\nlid :refer, var var clojure.set/union does not exist, :data {:tag :cljs/analysis-error}}}}\r\nCalling back!\r\n {:opts\r\n {:read-file-fn! \"<hidden function>\",\r\n  :init-fns \"<hidden function>\",\r\n  :write-file-fn! \"<hidden function>\",\r\n  :verbose true,\r\n  :cache {:src-paths-lookup? true},\r\n  :warning-as-error false,\r\n  :context :statement,\r\n  :load-fn! \"<hidden function>\",\r\n  :target :default,\r\n  :src-paths [\"/dbg/js\" \"/js/compiled/out\"]},\r\n :data\r\n {:form (ns my.aa (:require [clojure.set :as set :refer [union]])),\r\n  :ns cljs.user,\r\n  :target :default,\r\n  :on-success-fn! \"<hidden function>\"},\r\n :res\r\n {:error\r\n  #error {:message \"Could not parse ns form my.aa\", :data {:tag :cljs/analysis-error}, :cause #error {:message \"Invalid :refer, var var cloju\r\nre.set/union does not exist\", :data {:tag :cljs/analysis-error}}}}}\r\n\r\n:success? false, :form (ns my.aa (:require [clojure.set :as set :refer [union]])), :warning nil, :error #error {:message \"Could not parse ns\r\n form my.aa\", :data {:tag :cljs/analysis-error}, :cause #error {:message \"Invalid :refer, var var clojure.set/union does not exist\", :data {:\r\ntag :cljs/analysis-error}}}}\r\nklipse.compiler=> Calling back!\r\n {:opts\r\n {:read-file-fn! \"<hidden function>\",\r\n  :init-fns \"<hidden function>\",\r\n  :write-file-fn! \"<hidden function>\",\r\n  :verbose true,\r\n  :warning-as-error false,\r\n  :context :statement,\r\n  :load-fn! \"<hidden function>\",\r\n  :target :default,\r\n  :src-paths [\"/dbg/js\" \"/js/compiled/out\"]},\r\n :data\r\n {:form (ns my.aa (:require [clojure.set :as set :refer [union]])),\r\n  :ns foo.core$macros,\r\n  :target :default,\r\n  :on-success-fn! \"<hidden function>\"},\r\n :res\r\n {:error\r\n  #error {:message \"Could not parse ns form my.aa\", :data {:tag :cljs/analysis-error}, :cause #error {:message \"Invalid :refer, var var clojure.set/union does not exist\", :data {:tag :cljs/analysis-error}}}}}\r\n\r\n\r\n```"}}