From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: How can I tell guile to shut up? ;) Date: Fri, 01 Jul 2011 10:03:23 +0200 Message-ID: <874o36a0ms.fsf@pobox.com> References: <99db88be1896528082d33a77ec4cadbe.squirrel@webmail.kapsi.fi> <87y60lsjx5.fsf@pobox.com> <87pqlvyp9p.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309508694 7796 80.91.229.12 (1 Jul 2011 08:24:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 08:24:54 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 01 10:24:50 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcZ1s-00006B-G4 for guile-devel@m.gmane.org; Fri, 01 Jul 2011 10:24:48 +0200 Original-Received: from localhost ([::1]:43667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcZ1r-0007sy-9D for guile-devel@m.gmane.org; Fri, 01 Jul 2011 04:24:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcYhI-0002Hs-Mc for guile-devel@gnu.org; Fri, 01 Jul 2011 04:03:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcYhF-0007M9-Tf for guile-devel@gnu.org; Fri, 01 Jul 2011 04:03:32 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:54016 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcYhF-0007Lv-D9; Fri, 01 Jul 2011 04:03:29 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 6DF2A34A8; Fri, 1 Jul 2011 04:05:43 -0400 (EDT) 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:content-transfer-encoding; s=sasl; bh=EVEHgL4MoQnL Z1W63eq56340PiM=; b=oL9kZtLQ1ytEuRAWD6g0GJ6bUxXw9PV8Hy8Vq86QD/7H efpBwt2yB9MW9Dv/3+H6S8Si5OMg8kqnPBv/1x5rS21wp3k2gKC0nt2w+aQqhxBE Zyy5KeV9ib2nYVN50Wg7cNvEYGAaI6e9lH5LjSM7rJL0BCaOsgEkY1JS4LI2O14= 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:content-transfer-encoding; q=dns; s=sasl; b=yRM1V0 AWkpX9ZnHDtcLHBJqFzoOQQaw9rVFJdz76bkE/+jiJv6W4BGovtCMUcPcgYv+gy3 4s07eXab27G5RrRs4/Eui02ZtugOW3gD+jRq+y8rre1vQIK6ji0zWOgz3bVK74c+ +MkASrAV9eD7bNnCPhThVC46ak23S2xxyvMPM= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 66D0334A5; Fri, 1 Jul 2011 04:05:43 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 8A3BF34A4; Fri, 1 Jul 2011 04:05:42 -0400 (EDT) In-Reply-To: <87pqlvyp9p.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 30 Jun 2011 23:37:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: EAA621BE-A3B8-11E0-9CAA-5875C023C68D-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12618 Archived-At: Hi, On Thu 30 Jun 2011 23:37, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Andy Wingo skribis: > >> After some thinking, the base thing to do is just to add a warning port, >> and make warnings (non-fatal informative messages) write to that port. >> I have done this in the attached patches. Any objections? > > Ideally I=E2=80=99d preferred to keep current-warning-port in (system base > message), but since it=E2=80=99s needed in boot-9, we may have to make it > global. Or would the following work? Yeah I tried to do that, but since it's needed in C (potentially quite early, even before modules) and in Scheme I just bit the bullet and added it to the default env. > (define-module (guile-user) > #:autoload (system base compile) (compile compile-file) > + #:autoload (system base message) (%current-warning-port) > #:filename #f) Wouldn't work, because it's needed in (guile), not (guile-user). > Besides, it would be great if =E2=80=98*current-warning-prefix*=E2=80=99 = were handled > consistently, too. All this could certainly be factorized in a Scheme/C > function that takes care of using the right port and prefix. It would, but then you're talking about standardizing a `warning' function, and that's problematic, as some warnings will have source locations and others will not, and we already have `warn' in the base env which has a rest arg so it's not extensible with keywords, etc etc, and system base message is really about compiler warnings (requiring source location) and not all warnings, so it's a bit of a mess. (And that's not to mention more general logging facilities, with levels and categories and such.) Note that it is also possible to prefix all output with soft ports. Basically I appreciate the concerns but have not found a way to solve the whole problem nicely, so I kept it simple. As it seems we agree on the need for higher-level solutions based on a warning port accessible in (guile) and C, I'm going to see about committing something along these lines, and we can work on higher-level warning facilities later. Regards, Andy --=20 http://wingolog.org/