chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] pp and write ignore keyword-style


From: Sven Hartrumpf
Subject: Re: [Chicken-users] pp and write ignore keyword-style
Date: Wed, 21 Nov 2018 07:34:58 +0100 (CET)

John Cowan wrote on 2018-11-20 16:56:
> IMO, `write` should not respect `keyword-style` but use the invariant
> syntax `#:foo` for keywords, as that always works, whereas `foo:`
> and `:foo` don't.  The whole point of `write` is that you can reread
> the output with `read` and get something that is the same (in the
> sense of `equal?`) to what was written, modulo unwritable objects.

I see.
But my argument is about interoperability between implementations, e.g.
reading with Scheme implementation A code written by Scheme implementation B.
Many Schemes only support SRFI-88 keywords (arg1: , #:suffix).

Is there any Chicken function that can write code in this way?
('display' won't help here because of strings etc.)
If not, I would suggest a new parameter pretty-print-keyword-style for
the module (chicken pretty-print).

Ciao
Sven

> On Tue, Nov 20, 2018 at 4:52 PM Sven Hartrumpf <address@hidden> wrote:
> 
>> Hi.
>>
>> pp and write (in chicken 5) do not respect the parameter (keyword-style);
>> Only display respects keyword-style.
>>
>> #;1> (import (chicken pretty-print))
>> ; loading /usr/local/chicken-5.0.0-x32/lib/chicken/9/
>> chicken.pretty-print.import.so ...
>> #;2> (keyword-style)
>> #:suffix
>> #;3> (write '(arg1: 1))
>> (#:arg1 1)#;4> (pp '(arg1: 1))
>> (#:arg1 1)
>> #;5> (display '(arg1: 1))
>> (arg1: 1)#;6>
>>
>> Ciao
>> Sven
>>
>> _______________________________________________
>> Chicken-users mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]