unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Jean Abou Samra <jean@abou-samra.fr>
To: Guile User <guile-user@gnu.org>
Subject: Re: Silencing compilation warnings when calling compiler explicitly
Date: Wed, 10 Aug 2022 16:46:33 +0200	[thread overview]
Message-ID: <d3208a81-a71a-37bf-89fc-64347a811276@abou-samra.fr> (raw)
In-Reply-To: <22174a8e-e241-f2a6-b4da-1943fec989b6@abou-samra.fr>



Le 10/08/2022 à 16:42, Jean Abou Samra a écrit :
> Hi,
>
> I'm wondering if there is a simple way to shut up warnings emitted
> when calling compile in Guile 2.2. For example:
>
> (use-modules (system base compile))
>
> (display
>  (compile '(lambda (x)
>              (case x
>                ((5 5) 5)
>                ((6) 6)))
>           #:env (current-module)
>           #:opts '(#:warnings ())))
>
>
> From the code of compile in module/system/base/compile.scm (when
> checking out the v2.2.7 tag in the repository), it seems that
> the use of #:warning () in opts should turn off warnings, but
> this seems not to be the case, as the output is
>
> ;;; <unknown-location>: warning: duplicate datum 5 in clause ((5 5) 5) 
> of case expression (case x ((5 5) 5) ((6) 6))
> #<procedure 56451d956b58 (x)>
>
>
> So far, I've found
>
>
> (use-modules (system base compile))
>
> (define (make-null-port)
>   (make-soft-port
>    (vector
>     (lambda _ #f) ; output 1 char
>     (lambda _ #f) ; output string
>     (lambda () #f) ; flush output
>     #f ; get char
>     (lambda () #f) ; close
>     )
>    "w"))


Ah, of course, less than a minute after I sent my message, I found 
%make-void-port...

Still, is there a better way than playing with the port? I assume I am 
doing something wrong, as I would expect #:warning () to work.



  reply	other threads:[~2022-08-10 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 14:42 Silencing compilation warnings when calling compiler explicitly Jean Abou Samra
2022-08-10 14:46 ` Jean Abou Samra [this message]
2022-08-10 16:05 ` Jean Abou Samra
2022-08-10 16:14   ` Jean Abou Samra

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=d3208a81-a71a-37bf-89fc-64347a811276@abou-samra.fr \
    --to=jean@abou-samra.fr \
    --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).