Skip to content

Instantly share code, notes, and snippets.

@mfikes
Created June 14, 2019 21:49
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/cdebe349f21f475dc485d30625f801de to your computer and use it in GitHub Desktop.
Save mfikes/cdebe349f21f475dc485d30625f801de to your computer and use it in GitHub Desktop.
cljs.user=> (set! *print-fn-bodies* true)
true
cljs.user=> (defrecord Foo [x])
cljs.user/Foo
cljs.user=> (defn bar [^cljs.user/Foo foo] #(:y foo))
#'cljs.user/bar
cljs.user=> (bar (assoc (->Foo 1) :y 3))
#object[Function "function (){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(foo);
}"]
cljs.user=> (defn quux [^cljs.user/Foo foo] #(:x foo))
#'cljs.user/quux
cljs.user=> (quux (assoc (->Foo 1) :y 3))
#object[Function "function (){
return foo.x;
}"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment