Skip to content

Instantly share code, notes, and snippets.

@capitancook
Last active August 29, 2015 14:10
Show Gist options
  • Save capitancook/7861920eb52e5dd7f43a to your computer and use it in GitHub Desktop.
Save capitancook/7861920eb52e5dd7f43a to your computer and use it in GitHub Desktop.
show the hierarchy :cof for a given frame f - published in the post http://highorderdysfunctions.blogspot.com
(defn showcofs
"show the hierarchy :cof for a given frame f"
[f]
(let [cofs (fget f :cof :value) cofslist (#(if-not (seq? %)(list %) %) cofs)] ;1
(if (nil? cofs)
(vector f) ;2
(reduce #( conj %1 ((if-let [showproc (fget-ii %2 :showcofs :proc)] (eval showproc) (vector %2)) %2)) (vector f) cofslist)))) ;3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment