Skip to content

Instantly share code, notes, and snippets.

@myguidingstar
Created February 11, 2019 13:06
Show Gist options
  • Save myguidingstar/e883526c5db2448c38f692f6eeda952d to your computer and use it in GitHub Desktop.
Save myguidingstar/e883526c5db2448c38f692f6eeda952d to your computer and use it in GitHub Desktop.
(defprotocol EmittableAtom
(emit [this]))
(extend-protocol EmittableAtom
Boolean
(emit [boolean-val]
(if boolean-val "#t" "#f"))
Number
(emit [number] (str number))
String
(emit [string] string)
nil
(emit [a-nil] "null"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment