Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created February 13, 2016 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfikes/7342d6321868d4fc4a3d to your computer and use it in GitHub Desktop.
Save mfikes/7342d6321868d4fc4a3d to your computer and use it in GitHub Desktop.
get-from-both
cljs.user=> (require '[planck.core :refer [ns-resolve]])
nil
cljs.user=> (ns foo)
WARNING: foo is a single segment namespace at line 1 
nil
foo=> (def a 1)
#'foo/a
foo=> (ns bar)
WARNING: bar is a single segment namespace at line 1 
nil
bar=> (def a 2)
#'bar/a
bar=> (in-ns 'cljs.user)
nil
cljs.user=> (defn get-from-both [symbol]
       #_=>  [@(ns-resolve 'foo symbol) @(ns-resolve 'bar symbol)])
#'cljs.user/get-from-both
cljs.user=> (get-from-both 'a)
[1 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment