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"))