Question

After slime prints a Lisp form in REPL it puts some properties on it, that make it later able to introspect / expand it etc. Some times it is very useful, but other times I'd like to re-use the result as just text.

What is the quick way to remove this special property from a form?

Was it helpful?

Solution

Just print the last output to a string:

(princ-to-string *)

To expand a bit: SLIME implements something like presentations, which were introduced by Symbolics for its Dynamic Windows user interface. Presentations of Lisp objects can be in various forms: textual and graphical. They always remember the original objects - which makes them clickable/active. With Dynamic Windows you could also select a textual presentation and copy the output as a text to the editor killring. I would guess that SLIME/Emacs can do something similar.

OTHER TIPS

You can just right click on the presentation and choose Pretty-print, or move point to the presentation and invoke M-x slime-pretty-print-representation-at-point. This will pretty print the presentation in another buffer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top