[plt-scheme] Printing Structures without using custom-write

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Oct 10 15:34:16 EDT 2007

If you only want to turn this off for debugging, you might consider
just having a macro that doesn't install the custom write handlers
when in a debugging mode.


On 10/10/07, Sam TH <samth at ccs.neu.edu> wrote:
> In the implementation of Typed Scheme, I have a large number of
> structures, representing types, which have custom printers, via the
> custom-write structure property.  Sometimes, however, I'd like to be
> able to turn off the use of the custom-write property, and just see
> that actual contents of the structures.  However, there doesn't seem
> to be a way to do this at the moment.  Have I missed something?
> I can think of two possible solutions here:
> 1. Provide a parameter that controls whether the custom-write property
> is considered for the printing of structs.  This would have global
> effect, and therefore might not be what you want (it might have
> abstraction-breaking effects).
> 2. Call the custom writer with one additional (maybe optional for
> compatibility) argument that does writing, but without using the
> custom printer for the particular struct type under consideration.
> Then I could implement a parameter that controlled custom printing
> just for my structs.  However, this requires more effort on the part
> of custom printer authors.
> Are there other ideas on how this might work?  Are there other
> languages or systems that have encountered this issue, and solved it
> nicely?
> Thanks,
> --
> sam th
> samth at ccs.neu.edu
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.