Re: [Chicken-users] pp and write ignore keyword-style
> On Nov 21, 2018, at 11:05 AM, John Cowan wrote: > > Each of the :foo and foo: styles are supported by most of the 9, whereas the > SRFI-88 style was supported by only 4. See > https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/KeywordSyntax.md for > details > For your information, the last line of that page “If we adopt the #:foo style, Chicken, Bigloo, Guile, S7, Kawa and to some extent Racket will work out of the box.” is incorrect concerning Bigloo that only supports the :foo and foo: syntax. So in fact the foo: syntax is the most widely supported (by 7 implementations). Also, the #:foo syntax is used by Gambit for uninterned symbols (probably other implementations too because I remember taking that syntax from another Scheme implementation but I don’t remember which). Marc ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] pp and write ignore keyword-style
On Wed, Nov 21, 2018 at 1:35 AM Sven Hartrumpf wrote: But my argument is about interoperability between implementations, e.g. > reading with Scheme implementation A code written by Scheme implementation > B. > I fear that is a lost cause. Of 22 Schemes that I tested, only 8 support keywords at all. (Racket has something it calls keywords, but they are not self-evaluating or even expressions at all: only quoted keywords are expressions. They use SRFI 88 syntax.) Each of the :foo and foo: styles are supported by most of the 9, whereas the SRFI-88 style was supported by only 4. See https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/KeywordSyntax.md for details -- John Cowan http://vrici.lojban.org/~cowanco...@ccil.org Business before pleasure, if not too bloomering long before. --Nicholas van Rijn ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] pp and write ignore keyword-style
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 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 >> Chicken-users@nongnu.org >> https://lists.nongnu.org/mailman/listinfo/chicken-users >> ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] pp and write ignore keyword-style
Hi Sven, On 2018-11-20 22:51, Sven Hartrumpf wrote: > pp and write (in chicken 5) do not respect the parameter (keyword-style); > Only display respects keyword-style. This behaviour is intentional, for the reasons John describes. Refer to ticket #1332 for specifics about the change: https://bugs.call-cc.org/ticket/1332 Cheers, Evan ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] pp and write ignore keyword-style
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. On Tue, Nov 20, 2018 at 4:52 PM Sven Hartrumpf 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 > Chicken-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/chicken-users > ___ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users
[Chicken-users] pp and write ignore keyword-style
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 Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users