Skip to content

Commit

Permalink
Fix a few things plus some renaming and improved docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
hlship committed Nov 17, 2016
1 parent 8e73a77 commit 0f24e86
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/io/aviso/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@
(defn pretty-print
"Pretty-prints the supplied object to a returned string.
With no arguments, copies from the clipboard, parses as EDN, and returns the pretty-printed string."
With no arguments, copies from the clipboard, parses as EDN, and prints the EDN data to `*out*`,
returning nil."
{:added "0.1.33"}
([]
(-> (copy) edn/read-string pretty-print))
(-> (copy) edn/read-string pprint))
([object]
(print-exception object
:stream nil
:pretty true)))
(write object
:stream nil
:pretty true)))

(defn paste
"Pastes a string in as the new content of the Clipboard.
Expand All @@ -118,14 +119,18 @@
[^String s]
(.setContents (clipboard) (StringSelection. s) nil))

(defn reformat-exception
"Passed the standard exception text and reformats it using [[parse-exception]] and
(defn format-exception
"Passed the standard exception text and formats it using [[parse-exception]] and
[[write-exception]], returning the formatted exception text.
With no arguments, parses the clipboard text and writes that."
With no arguments, parses the clipboard text and prints the formatted exception
to `*out*` (returning nil)."
{:added "0.1.33"}
([]
(reformat-exception (copy)))
(e/write-exception* *out*
(-> (copy)
(e/parse-exception nil))
nil))
([text]
(writer/into-string
e/write-exception* (e/parse-exception text nil) nil)))

0 comments on commit 0f24e86

Please sign in to comment.