Skip to content

Instantly share code, notes, and snippets.

@allison-casey
Created February 2, 2020 20:13
Show Gist options
  • Save allison-casey/a654120e0806869f95601996d2df6462 to your computer and use it in GitHub Desktop.
Save allison-casey/a654120e0806869f95601996d2df6462 to your computer and use it in GitHub Desktop.
(defn sqisp-repr [obj]
(cond
(set? obj) (format ["#{%1}" (joinString (map sqisp-repr (iter-items obj)) ", ")])
(map? obj) (format ["{%1}"
(joinString
(map (fn [x]
(joinString [(sqisp-repr (first x))
(sqisp-repr (second x))]
" "))
(iter-items obj)) ", ")])
(vec? obj) (format ["[%1]" (joinString (map sqisp-repr obj) ", ")])
(string? obj) obj
true (str obj)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment