-
Notifications
You must be signed in to change notification settings - Fork 17
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
Global print settings #25
base: master
Are you sure you want to change the base?
Conversation
If the writter function cannot find print settings for the given message, it uses global print settings.
This helps us use print settings of parent sessions when needed.
A default value may avoid a breaking change. |
@cgrand yeah I thought of that, but we would have to define a way to declare (as data) optional parameters in session action templates, and (hopefully) it should not be something too complicated so that clients that are not written in Clojure(Script) are able to parse it and understand it, like specs. Another option I thought of was creating a new name for it, and leave In reality, the API I'd like to expose for clients would be something similar to
But I couldn't decide how to expand our representation of parameters. I also avoided |
This function will elide content and will provide print-settings information for the execution context
I'm un Btw, I know that it might be hard to review |
Fixes #17.
The best way to review this PR is to check out the first two commits, which contains all of the new logic to the feature. The third commit has a huge diff but very little new stuff to it, because it's basically adding an optional parameter to
unrepl/start
, which reindent the whole function. The only three changes in that whole commit can be found here, here, and here.Implementation detail:
print-settings
map to session state that has the following keys::eval :out :err :log :exception
, and for each these keys, there's a map with:string-length :coll-length :nesting-depth
.write-here
will now try to find the print context out of the given messagex
. If it exist and it's part of theprint-settings
it will bind the print variables accordingly, if not, it will use the default (seedefault-print-settings
parent-session-id
tounrepl/start
so that aux sessions can fetch print settings from parent sessions.Stuff missing:
:print-settings
session action changed its signature to:[context string-length coll-length nesting-depth]
, which is a breaking change and should be added to the README.