unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: How can I tell guile to shut up? ;)
Date: Fri, 01 Jul 2011 10:03:23 +0200	[thread overview]
Message-ID: <874o36a0ms.fsf@pobox.com> (raw)
In-Reply-To: <87pqlvyp9p.fsf@gnu.org> ("Ludovic Courtès"'s message of "Thu, 30 Jun 2011 23:37:22 +0200")

Hi,

On Thu 30 Jun 2011 23:37, ludo@gnu.org (Ludovic Courtès) writes:

> Andy Wingo <wingo@pobox.com> 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’d preferred to keep current-warning-port in (system base
> message), but since it’s 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 ‘*current-warning-prefix*’ 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
-- 
http://wingolog.org/



  reply	other threads:[~2011-07-01  8:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <99db88be1896528082d33a77ec4cadbe.squirrel@webmail.kapsi.fi>
2011-03-31 11:11 ` How can I tell guile to shut up? ;) Andy Wingo
2011-06-28 21:52   ` Andy Wingo
2011-06-30  1:24     ` Andreas Rottmann
2011-06-30  9:23       ` Andy Wingo
2011-06-30 21:27         ` Ludovic Courtès
2011-07-01  8:16           ` Andy Wingo
2011-07-01 13:04             ` Ludovic Courtès
2011-07-01 14:26               ` Andy Wingo
2011-07-04 13:24                 ` Ludovic Courtès
2011-07-18 21:57                 ` Fluids vs parameters: which API is better? Mark H Weaver
2011-07-19  8:19                   ` Andy Wingo
2011-07-24 14:52                     ` BT Templeton
2011-07-25  9:24                       ` Ludovic Courtès
2011-07-25 14:21                         ` Andy Wingo
2011-12-05 17:15       ` How can I tell guile to shut up? ;) Andy Wingo
2011-06-30 21:37     ` Ludovic Courtès
2011-07-01  8:03       ` Andy Wingo [this message]
2011-07-01 12:49         ` Ludovic Courtès
     [not found] <502390579.3690191.1452334008441.JavaMail.yahoo.ref@mail.yahoo.com>
2016-01-09 10:06 ` Tobias Reithmaier

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=874o36a0ms.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=ludo@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).