-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a :print-fallback key to *options* to fall back on pr-str #18
Conversation
This commit adds a `:print-fallback` key (default false) to the puget.printer/*options* map. Setting the value to true will cause Puget to fall back on an object's `pr-str` value rather than printing its class information.
@@ -121,7 +126,7 @@ | |||
|
|||
|
|||
(defn- illegal-when-strict! | |||
"Throws an exception if strict mode is enabled. The error indincates that the | |||
"Throws an exception if strict mode is enabled. The error indicates that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, nice catch.
This moves `:print-fallback` from being a simple boolean to taking a keyword value, which is checked as part of a case statement in `unknown-document`
@@ -35,6 +35,11 @@ | |||
The text placed between a map key and a collection value. The keyword :line | |||
will cause line breaks if the whole map does not fit on a single line. | |||
|
|||
`:print-fallback` | |||
Takes a keyword argument specifying the desired string representation of | |||
uknown documents. The keyword :print will fall back to using `pr-str` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 'uknown' should be 'unknown'. Also, put backticks around :print
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, whoops.
Nice, this looks better. One more minor comment and we're good to go. |
1 similar comment
Add a :print-fallback key to *options* to fall back on pr-str
Any thoughts on when we might see this percolate up to Whidbey? |
I'll release 0.7.1 in the next day or two. |
Released whidbey 0.5.1 with a dependency on puget 0.7.1. |
Fantastic! Thanks so much :) I should have a release for Ultra (likely 0.3.0) in the next day or so as well. |
No problem, thanks for the contribution. 👍 Ultra has certainly been good exposure for puget and whidbey. :) |
This commit adds a
:print-fallback
key (default false) to thepuget.printer/options map. Setting the value to true will cause Puget
to fall back on an object's
pr-str
value rather than printing itsclass information.
I believe this should resolve venantius/ultra#8 once the dependency graph for Whidbey has also been updated.