Skip to content

Commit

Permalink
Use case instead of cond in visit-unknown.
Browse files Browse the repository at this point in the history
  • Loading branch information
greglook committed Oct 12, 2015
1 parent ac17e0e commit 2539d1a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/puget/printer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -330,21 +330,20 @@

(visit-unknown
[this value]
(cond
(= :pretty print-fallback)
(case print-fallback
:pretty
(format-unknown this value)
(= :print print-fallback)
:print
[:span (pr-str value)]
(= :error print-fallback)
:error
(throw (IllegalArgumentException.
(str "No defined representation for " (class value) ": "
(pr-str value))))
(ifn? print-fallback)
(if (ifn? print-fallback)
(print-fallback this value)
:else
(throw (IllegalStateException.
(str "Unsupported value for print-fallback: "
(pr-str value)))))))
(pr-str print-fallback))))))))



Expand Down

0 comments on commit 2539d1a

Please sign in to comment.