unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: John Cowan <cowan@ccil.org>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: Srfi-159/166 - monadic formatting for guile
Date: Sun, 16 Jun 2019 15:30:07 -0400	[thread overview]
Message-ID: <87r27tuy4g.fsf@netris.org> (raw)
In-Reply-To: <CAD2gp_SkZ1eG0xwkg8=9ZOnYgsjS7LSJRsLaWeL4UVS+JzgfMQ@mail.gmail.com> (John Cowan's message of "Sun, 16 Jun 2019 12:20:55 -0400")

Hi John,

John Cowan <cowan@ccil.org> writes:

> On Sun, Jun 16, 2019 at 2:47 AM Mark H Weaver <mhw@netris.org> wrote:
>
>
>> How do you implement 'written-shared', 'pretty-shared', and
>> 'trimmed/lazy'?  In particular, how do you avoid non-termination when
>> asked to print cyclic data, when the cycle includes a non-standard data
>> type printed using a custom printer?  For example, what if you print a
>> list that includes an object whose custom printer will print output that
>> includes the same list that you started with?
>>
>
> Of course it can't cope with that.  But consider an object whose custom
> printer outputs its instance variables where one of those instance variables
> has been assigned to the object itself.  No procedure other than the object
> printer itself is going to be able to break *that* loop.

The built-in 'write' and 'display' procedures can break the loop, which
is the approach that I chose when I last looked at this.

     Regards,
       Mark



  reply	other threads:[~2019-06-16 19:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-02 13:38 Srfi-159/166 - monadic formatting for guile Linus Björnstam
2019-06-02 20:31 ` Arne Babenhauserheide
2019-06-02 20:41 ` Ludovic Courtès
2019-06-03  5:34   ` Linus Björnstam
2019-06-03 13:07     ` Ludovic Courtès
2019-06-11 22:01 ` Mark H Weaver
2019-06-14  9:38   ` Linus Björnstam
2019-06-16  6:35     ` Mark H Weaver
2019-06-16 16:20       ` John Cowan
2019-06-16 19:30         ` Mark H Weaver [this message]
2019-06-18 10:39           ` Linus Björnstam
2019-06-16 20:30       ` Linus Björnstam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r27tuy4g.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=cowan@ccil.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).