From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: Srfi-159/166 - monadic formatting for guile Date: Sun, 16 Jun 2019 15:30:07 -0400 Message-ID: <87r27tuy4g.fsf@netris.org> References: <87pnnj7pd9.fsf@netris.org> <87wohm2g1k.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221134"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: guile-user To: John Cowan Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jun 16 21:35:09 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcavk-000vNA-2w for guile-user@m.gmane.org; Sun, 16 Jun 2019 21:35:08 +0200 Original-Received: from localhost ([::1]:42466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcavi-0004HU-Fi for guile-user@m.gmane.org; Sun, 16 Jun 2019 15:35:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43256) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcavU-0004HA-M1 for guile-user@gnu.org; Sun, 16 Jun 2019 15:34:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcavT-0008WU-KN for guile-user@gnu.org; Sun, 16 Jun 2019 15:34:52 -0400 Original-Received: from world.peace.net ([64.112.178.59]:51880) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcavT-0008Vk-Gl for guile-user@gnu.org; Sun, 16 Jun 2019 15:34:51 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcavS-0006eD-F6; Sun, 16 Jun 2019 15:34:50 -0400 In-Reply-To: (John Cowan's message of "Sun, 16 Jun 2019 12:20:55 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.112.178.59 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15566 Archived-At: Hi John, John Cowan writes: > On Sun, Jun 16, 2019 at 2:47 AM Mark H Weaver 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