[slime-devel] Daily ChangeLog diff
Matthias Koeppe
mkoeppe+slime at mail.math.uni-magdeburg.de
Fri Dec 11 20:18:37 UTC 2009
On Fri, Dec 11, 2009 at 11:58 AM, Tobias C. Rittweiler <tcr at freebits.de> wrote:
> Matthias Koeppe <mkoeppe+slime at mail.math.uni-magdeburg.de> writes:
>
>> On Fri, Dec 11, 2009 at 12:33 AM, Helmut Eller <heller at common-lisp.net> wrote
>>> Index: slime/ChangeLog
>>> +2009-12-11 Stas Boukarev <stassats at gmail.com>
>>> +
>>> + * slime-presentations.el (slime-reify-old-output): Quote
>>> + the CL expession behind presentations, so _(1 2 3)_ (representing a
>>> + presentation) is not tried to be evaluated.
>>> [...]
>>> + Patch by Tobias C. Rittweiler.
>>
>> I do not agree with this change. It causes breakage when
>> presentations are used within quoted lists, for instance.
>>
>> CL-USER> (find-class 'standard-object)
>> #<STANDARD-CLASS STANDARD-OBJECT>
>> CL-USER> '(1 2 #<STANDARD-CLASS STANDARD-OBJECT> 3 4)
>> (1 2 '#<STANDARD-CLASS STANDARD-OBJECT> 3 4)
>> CL-USER>
>
> Can you think of a way to make it work for either case? Evaluating
> lists-as-presentations is annoying.
Unfortunately not, though I have been thinking about this since 2006
(well, OK, not every day!), when we discussed this issue first on this
list.
Definitely not on the level of presentation reification, but see below.
I think this is basically just something for the documentation.
"Remember, standard quoting rules still apply." and show the example with lists.
Here are two reasons why the non-quoting behavior should be considered
a design feature actually.
* Presentations sometimes just go away (when the objects are no longer
stored) and revert to plain text. It would be very unfortunate if the
semantics magically changed in these situations from unevaluated to
evaluated.
* Presentations right now only *extend* the behavior of the reader,
they don't change the reader syntax. Only some otherwise unreadable
objects are made "readable" by presentations; some objects are reused
(keeping the same identity) rather than being recreated.
That said, it may be useful to experiment with a heuristic on the
level of *pasting* the presentations in editor commands such as
slime-copy-presentation-at-point-to-repl. Basically, try to find out
(1) whether the current context at the insertion is evaluated, (2)
whether the object is a list; only then insert a ' in front of the
pasted presentation. Because this is transparent to the user, it can
always be corrected by the user.
Of course, this creates a difference between dedicated presentation
pasting commands and ordinary kill&yank commands (which, as you know,
work just fine for text containing presentations). So this adds some
complexity, which is why I am not sure it will pay off...
Matthias
--
Matthias Koeppe -- http://www.math.ucdavis.edu/~mkoeppe
More information about the slime-devel
mailing list