slime-presentations: have different way of inserting the value #734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For example:
With the existing behavior, there is an error:
With the
QUOTE
strategy of the patch, the value is self-evaluating, and the above example results in a valid expression.Remarks
I find the QUOTE approach more logical when thinking about presentations as opaque objects, but I understand that this might not be how other people understand them.
My first fix was to locally change
slime-reify-old-output
to add a quote for all inserted values. But then I encountered warnings when trying to mutate inserted presentation values (using SBCL).I personally resolved this by setting
swank-repl::*listener-eval-function*
to a wrapper that always configure SBCL to use the:INTERPRET
evaluation-mode, which seems better for the REPL. But it appears that wrapping the quoted form in EVAL also works to silence the warning.So, this patch introduces a customization for slime-presentations, i.e. a way to choose how they are inserted. I also added the old behavior, where the form is inserted literally for evaluation (not at read-time), but this might not be necessary.
The default value respects the existing behavior.