From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: divoplade Newsgroups: gmane.lisp.guile.user,gmane.lisp.scheme.srfi.srfi-64 Subject: Re: test-equal: actual returned value is #f when tested expression raises execption Date: Sat, 20 Feb 2021 12:26:46 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17153"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: =?ISO-8859-1?Q?J=E9r=E9my?= Korwin-Zmijowski , srfi-64@srfi.schemers.org, Mailing list Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Feb 20 12:27:40 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lDQQG-0004ME-Kw for guile-user@m.gmane-mx.org; Sat, 20 Feb 2021 12:27:40 +0100 Original-Received: from localhost ([::1]:37204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDQQF-0003Vw-C1 for guile-user@m.gmane-mx.org; Sat, 20 Feb 2021 06:27:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDQPk-0003Vm-56 for guile-user@gnu.org; Sat, 20 Feb 2021 06:27:08 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:37005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDQPh-0006Qr-Nk for guile-user@gnu.org; Sat, 20 Feb 2021 06:27:07 -0500 Original-Received: from pruneau.home (lfbn-poi-1-1269-178.w90-78.abo.wanadoo.fr [90.78.202.178]) (Authenticated sender: d@divoplade.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 449F2100007; Sat, 20 Feb 2021 11:26:56 +0000 (UTC) In-Reply-To: Received-SPF: pass client-ip=217.70.178.231; envelope-from=d@divoplade.fr; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17283 gmane.lisp.scheme.srfi.srfi-64:70 Archived-At: Hello, This is what I understand from guile. I am no expert, so maybe it is not 100% accurate! Le samedi 20 février 2021 à 12:03 +0100, Jérémy Korwin-Zmijowski a écrit : > > Running `guile -L . char-sets-test.scm` in the file location will > produce the following output : > > $ guile -L . char-sets-test.scm > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /tmp/char-sets-test.scm > ;;; WARNING: compilation of /tmp/char-sets-test.scm failed: > ;;; no code for module (char-sets) >From now on, char-sets-test.scm has been compiled, but guile did not find password-valid?, so it assumed that this function will be available at run time when needed. Maybe some crazy macro expansion, who knows? > > And now, I rerun the tests : > > $ guile -L . char-sets-test.scm > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /tmp/char-sets-test.scm > ;;; compiling ./char-sets.scm > ;;; compiled /home/jeko/.cache/guile/ccache/3.0-LE-8-4.4/tmp/char- > sets.scm.go > ;;; char-sets-test.scm:10:2: warning: possibly unbound variable > `password-valid?' > ;;; compiled /home/jeko/.cache/guile/ccache/3.0-LE-8-4.4/tmp/char- > sets- > test.scm.go > %%%% Starting test harness-char-sets (Writing full log to "harness- > char-sets.log") > # of expected passes 1 Guile did not re-compile the test, because the code did not change, but remembered from last time that password-valid? was potentially missing, so it issues the warning again when loading the bytecode. However, since now there's a char-sets.scm, it can use the module and find the function, and everything works correctly. Everything works because guile does not inline code from a module to another. So the warning is just a warning. You don't need to worry.