[plt-scheme] Trying to reliably turn a value into a list of snips

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed May 28 17:48:26 EDT 2008

Did you try just using `print' and then redirecting the output to your
editor snip's ports?


On Wed, May 28, 2008 at 4:46 PM, Danny Yoo <dyoo at cs.wpi.edu> wrote:
>> DrScheme uses the pretty-printer when printing values in order to know
>> what to do with snips that are embedded in other data structures. Is that
>> one of the pieces that you need? Specifically, it overrides hooks to let it
>> control how sub-expressions are printed and if it encounters a snip there,
>> it just inserts (a copy of) the snip into the buffer.
>> The drscheme:language:add-snip-value is used so that other values can be
>> turned into snips (or so that some snips can be rendered differently when
>> they appear, eg picts are bitmap-ized so that the drawing callbacks don't
>> ever happen on a drscheme thread).
> Hi Robby,
> Yes, I'm trying to get at the pretty-printer that the RePL uses.  I think I
> might be able to reuse the pretty-printer by using the render-value
> functions from the language support in the "tool.ss" library in "drscheme".
> But one complication is that my entry point is in the heart of an
> decorated-editor-snip% object.  I'm trying to write a custom snip that
> displays its contents just like the interaction REPL. I'm unfamiliar enough
> with DrScheme's structure that I'm having some trouble getting at the
> language object from my snip's callback...
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.