Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created March 28, 2013 06:48
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 frenchy64/5261196 to your computer and use it in GitHub Desktop.
Save frenchy64/5261196 to your computer and use it in GitHub Desktop.
Record method names
clojure.core.typed.test.records=> (-> (macroexpand
'(defrecord A [a]
Object
(toString [this] this)))
clojure.pprint/pprint)
(let*
[]
(clojure.core/declare ->A)
(clojure.core/declare map->A)
(deftype*
A
clojure.core.typed.test.records.A
[a __meta __extmap]
:implements
[clojure.lang.IRecord
clojure.lang.IHashEq
clojure.lang.IObj
clojure.lang.ILookup
clojure.lang.IKeywordLookup
clojure.lang.IPersistentMap
java.util.Map
java.io.Serializable]
; why is this qualified?
(clojure.core/entrySet
[this__5761__auto__]
(clojure.core/set this__5761__auto__))
(clojure.core/values
[this__5760__auto__]
(clojure.core/vals this__5760__auto__))
(clojure.core/keySet
[this__5759__auto__]
(clojure.core/set (clojure.core/keys this__5759__auto__)))
(clojure.core/clear
[this__5758__auto__]
(throw (java.lang.UnsupportedOperationException.)))
(clojure.core/putAll
[this__5756__auto__ m__5757__auto__]
(throw (java.lang.UnsupportedOperationException.)))
(clojure.core/remove
[this__5754__auto__ k__5755__auto__]
(throw (java.lang.UnsupportedOperationException.)))
(clojure.core/put
[this__5751__auto__ k__5752__auto__ v__5753__auto__]
(throw (java.lang.UnsupportedOperationException.)))
(clojure.core/get
[this__5749__auto__ k__5750__auto__]
(.valAt this__5749__auto__ k__5750__auto__))
(clojure.core/containsValue
[this__5747__auto__ v__5748__auto__]
(clojure.core/boolean
(clojure.core/some
#{v__5748__auto__}
(clojure.core/vals this__5747__auto__))))
(clojure.core/isEmpty
[this__5746__auto__]
(clojure.core/= 0 (.count this__5746__auto__)))
(clojure.core/size [this__5745__auto__] (.count this__5745__auto__))
(clojure.core/without
[this__5743__auto__ k__5744__auto__]
(if
(clojure.core/contains? #{:a} k__5744__auto__)
(clojure.core/dissoc
(clojure.core/with-meta
(clojure.core/into {} this__5743__auto__)
__meta)
k__5744__auto__)
(new
A
a
__meta
(clojure.core/not-empty
(clojure.core/dissoc __extmap k__5744__auto__)))))
(clojure.core/assoc
[this__5741__auto__ k__5742__auto__ G__24072]
(clojure.core/condp
clojure.core/identical?
k__5742__auto__
:a
(new A G__24072 __meta __extmap)
(new
A
a
__meta
(clojure.core/assoc __extmap k__5742__auto__ G__24072))))
(clojure.core/iterator
[this__5740__auto__]
(clojure.lang.SeqIterator. (.seq this__5740__auto__)))
(clojure.core/seq
[this__5739__auto__]
(clojure.core/seq
(clojure.core/concat [(new clojure.lang.MapEntry :a a)] __extmap)))
(clojure.core/entryAt
[this__5735__auto__ k__5736__auto__]
(clojure.core/let
[v__5737__auto__
(.valAt this__5735__auto__ k__5736__auto__ this__5735__auto__)]
(clojure.core/when-not
(clojure.core/identical? this__5735__auto__ v__5737__auto__)
(clojure.lang.MapEntry. k__5736__auto__ v__5737__auto__))))
(clojure.core/containsKey
[this__5733__auto__ k__5734__auto__]
(clojure.core/not
(clojure.core/identical?
this__5733__auto__
(.valAt this__5733__auto__ k__5734__auto__ this__5733__auto__))))
(clojure.core/equiv
[this__5732__auto__ G__24072]
(clojure.core/boolean
(clojure.core/or
(clojure.core/identical? this__5732__auto__ G__24072)
(clojure.core/when
(clojure.core/identical?
(clojure.core/class this__5732__auto__)
(clojure.core/class G__24072))
(clojure.core/let
[G__24072 G__24072]
(clojure.core/and
(clojure.core/= a (. G__24072 -a))
(clojure.core/= __extmap (. G__24072 __extmap))))))))
(clojure.core/cons
[this__5730__auto__ e__5731__auto__]
(#'clojure.core/imap-cons this__5730__auto__ e__5731__auto__))
(clojure.core/empty
[this__5729__auto__]
(throw
(java.lang.UnsupportedOperationException.
(clojure.core/str
"Can't create empty: "
"clojure.core.typed.test.records.A"))))
(clojure.core/count
[this__5728__auto__]
(clojure.core/+ 1 (clojure.core/count __extmap)))
(clojure.core/getLookupThunk
[this__5726__auto__ k__5727__auto__]
(clojure.core/let
[gclass (clojure.core/class this__5726__auto__)]
(clojure.core/case
k__5727__auto__
:a
(clojure.core/reify
clojure.lang.ILookupThunk
(clojure.core/get
[thunk gtarget]
(if
(clojure.core/identical? (clojure.core/class gtarget) gclass)
(. gtarget -a)
thunk)))
nil)))
(clojure.core/valAt
[this__5723__auto__ k__5724__auto__ else__5725__auto__]
(clojure.core/case
k__5724__auto__
:a
a
(clojure.core/get __extmap k__5724__auto__ else__5725__auto__)))
(clojure.core/valAt
[this__5721__auto__ k__5722__auto__]
(.valAt this__5721__auto__ k__5722__auto__ nil))
(clojure.core/withMeta
[this__5720__auto__ G__24072]
(new A a G__24072 __extmap))
(clojure.core/meta [this__5719__auto__] __meta)
(clojure.core/equals
[this__5718__auto__ G__24072]
(clojure.lang.APersistentMap/mapEquals this__5718__auto__ G__24072))
(clojure.core/hashCode
[this__5717__auto__]
(clojure.lang.APersistentMap/mapHash this__5717__auto__))
(clojure.core/hasheq
[this__5716__auto__]
(clojure.core/bit-xor
1188737923
(clojure.lang.APersistentMap/mapHasheq this__5716__auto__)))
(toString [this] this))
(clojure.core/import clojure.core.typed.test.records.A)
(clojure.core/defn
->A
"Positional factory function for class clojure.core.typed.test.records.A."
[a]
(new clojure.core.typed.test.records.A a))
(clojure.core/defn
map->A
"Factory function for class clojure.core.typed.test.records.A, taking a map of keywords to field values."
([m__5818__auto__]
(clojure.core.typed.test.records.A/create m__5818__auto__)))
clojure.core.typed.test.records.A)
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment