[slime-devel] Slime presentation marker bug (updated patch attached)
Nathan Bird
nathan at acceleration.net
Thu Sep 30 21:19:14 UTC 2010
>> The use case I have (a
>> stream logger who's printed objects are automatically presentations where
>> appropriate) is precisely as above though: I want to print to a memory
>> buffer and then dump that to the dedicated stream. When running a bunch of
>> threads this still isn't threadsafe behavior by any means but it reduces the
>> critical section to just (write-sequence<short-message> stream).
> I would suggest to create a solution with a dynamic variable that is a
> list of eligible streams. And it should only kick in dedicated mode.
>
There isn't really a dedicated mode; the behavior is geared around the
stream it is writing to, not a general mode we are in.
I made a version with a dynamic variable list of additional eligible
streams[1]; the variable is only used if *use-dedicated-output-stream*
is true. Beyond that there isn't anything beyond the documentation and
good sense that enforces it.
I wrote a macro that tried to provide that guard-and-buffer but it ended
up looking fairly specific to this use case so I don't think it is
really worth including.
> For your use case, an interesting solution could also be a custom
> string stream class that queues up the strings and presentation
> markers. This would be in parallel to the pretty printing streams in
> Allegro CL and my patched version of SBCL's.
While a fun idea that appears to be a lot more work vs an already
working system.
[1]
http://github.com/UnwashedMeme/slime/blob/master/contrib/swank-presentation-streams.lisp#L81
--
Nathan Bird
nathan at acceleration.net
http://www.acceleration.net/
Custom Programming, Design, Hosting, and Broadband.
More information about the slime-devel
mailing list