[plt-dev] Re: [plt-bug] all/10895: quasiquote printing is buggy, confusing

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Mon May 10 14:29:49 EDT 2010

On Mon, May 10, 2010 at 2:02 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>>
>> This suggests that no one is writing custom printers that should be
>> quoted.  Further, since there's no mechanism for structs to
>> automatically extend the read syntax and the behavior of `quote', only
>> very rarely will structs be usefully printed in a quoted form.  Both
>> of these pieces of evidence suggest to me that quoting is the wrong
>> default.
>
> I think the piece/default that's missing is an "unreadable" property.
> There's currently no way to say that a custom-write procedure produces
> unreadable output, even though the printer otherwise treats unreadable
> values specially: It doesn't put a quote in front, although it lets a
> unreadable value be quoted if it appears within otherwise quotable
> value).
>
> So, how about replacing `prop:custom-print-as-expression' with
> `prop:custom-print-mode' whose value is either 'unreadable,
> 'unquotable, or 'quotable, where the default is effectively
> 'unreadable?

I think the default should be unquotable, because it is the only mode
that sensibly allows a custom printer to recursively print contained
values (that might themselves be unquotable).

--Carl


Posted on the dev mailing list.