From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Enable truncation of exception output Date: Fri, 10 Mar 2017 09:47:13 +0100 Message-ID: <87r325tt66.fsf@pobox.com> References: <38205FE3-791F-4EE8-BD7F-07BC6C0511DE@bluewin.ch> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489135654 3872 195.159.176.226 (10 Mar 2017 08:47:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Mar 2017 08:47:34 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: guile-devel To: Daniel Llorens Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 10 09:47:30 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmGCu-0000IC-T6 for guile-devel@m.gmane.org; Fri, 10 Mar 2017 09:47:29 +0100 Original-Received: from localhost ([::1]:38016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmGCz-0002bk-AG for guile-devel@m.gmane.org; Fri, 10 Mar 2017 03:47:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmGCr-0002bc-Nj for guile-devel@gnu.org; Fri, 10 Mar 2017 03:47:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmGCo-0000gz-IR for guile-devel@gnu.org; Fri, 10 Mar 2017 03:47:25 -0500 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:50548 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmGCo-0000gu-Cy for guile-devel@gnu.org; Fri, 10 Mar 2017 03:47:22 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 55CF37EAC5; Fri, 10 Mar 2017 03:47:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=7J2COGwZ1ef+knI6iFwwlwk/3aw=; b=OXNM0D +2bihP2Z78uvpkXrNQp9yXlTIrHaWDOrQA5QlxFNkOz/cnOlqGGVmL21P+c199y/ qG7JRMZZ5Rdl8xdpR1CbvPNXZsKrq8X6dAkZJ22RS6cXpiKb2ILSUC0yYgTUzP1/ ImqbZRCPGeXDVoYptcnnK6BEAumwQumawsClk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=GX9njJnO55SnF98X8vxwnn8HPvIlod8r YVdyZRqnnnMm+C1WUJAwTTmpfYo6PZ3q9hxQnHSGKbwZ3cRhwTmNV3YTwrspM4Y3 evTOpmgy5RIbuOVe2NwIQU81GjK+v7l69q8cI2Qv9z8oHMtKbrwtnRmsmK1OkLP3 NW8/LTyxBRQ= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 4E83B7EAC4; Fri, 10 Mar 2017 03:47:21 -0500 (EST) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 644557EAC3; Fri, 10 Mar 2017 03:47:20 -0500 (EST) In-Reply-To: <38205FE3-791F-4EE8-BD7F-07BC6C0511DE@bluewin.ch> (Daniel Llorens's message of "Fri, 3 Feb 2017 14:40:33 +0100") X-Pobox-Relay-ID: 2C5DA90C-056E-11E7-B958-B667064AB293-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19018 Archived-At: On Fri 03 Feb 2017 14:40, Daniel Llorens writes: > The patch to master (ice-9 boot-9) lets you override the (format) used > internally by the exception printers. Then I rewrite the format string > in user code, see below. It's a bit hacky, maybe someone has a better > solution. > > See also the other patch I've posted to the list to support arrays in > (truncated-print). The patches are independent, but they make each > other useful so to speak. I have a crazy idea :) What about, we just let (ice-9 format) be "format" ? Right now loading (ice-9 format) does a set! to format, as you know, overriding the core binding. This is unnecessary and complicated. I see that using (ice-9 format) only adds 50 KB to the 2828-KB baseline of private dirty memory. Then we can use :@y directly in the format strings and we can avoid all the monkeypatching. There are only a couple instances of calls to scm_simple_format in libguile and they can be replaced, so we don't have C bootstrapping concerns. Guile users calling scm_simple_format would do a pthread_once load to the "format" binding in the root module. In boot-9, we start with a simple boot definition (for boot-time errors) then replace it with (module-ref (resolve-interface '(ice-9 format) 'format)) at the end. Maybe Ludovic has a thought here :) Andy