From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?ISO-8859-1?Q?J=E9r=E9my?= Korwin-Zmijowski Newsgroups: gmane.lisp.guile.user Subject: Re: Guile Hacker Handbook - Character sets Date: Fri, 19 Feb 2021 22:31:48 +0100 Message-ID: <922a13555263f943bdb09e1979d306787a0abd31.camel@korwin-zmijowski.fr> References: <87im6oh6te.fsf@web.de> 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="8012"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 Cc: guile-user@gnu.org To: "Dr. Arne Babenhauserheide" Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Feb 19 22:33:42 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 1lDDPC-0001yH-Ce for guile-user@m.gmane-mx.org; Fri, 19 Feb 2021 22:33:42 +0100 Original-Received: from localhost ([::1]:47692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDDPB-00025Z-9v for guile-user@m.gmane-mx.org; Fri, 19 Feb 2021 16:33:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDDNV-00011b-2D for guile-user@gnu.org; Fri, 19 Feb 2021 16:31:57 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:39141) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDDNS-00010z-OH for guile-user@gnu.org; Fri, 19 Feb 2021 16:31:56 -0500 Original-Received: from [192.168.1.3] (91-169-127-99.subs.proxad.net [91.169.127.99]) (Authenticated sender: jeremy@korwin-zmijowski.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 3927D100002; Fri, 19 Feb 2021 21:31:48 +0000 (UTC) In-Reply-To: <87im6oh6te.fsf@web.de> Received-SPF: none client-ip=217.70.178.231; envelope-from=jeremy@korwin-zmijowski.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_NONE=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:17278 Archived-At: Le vendredi 19 février 2021 à 08:09 +0100, Dr. Arne Babenhauserheide a écrit : > Hi Jérémy, Hey Dr. Arne ! > Thank you for your book! My pleasure :) > How you’re describing char-sets using a clear use-case looks really > good! Thank you, I appreciate that. > A few comments: > > # Try and run the test > > here you write “the test fails”, which is slightly unprecise. The > precise wording would be “the test will fail to run”. You're right, I'm correcting this right now. > # Write the minimal … > > I wonder why the test-suite returns "passes 1" in the second try > (with > undefined password-valid?). This is something very annoying indeed and it forces you to be very careful. I haven't the answer to your question. I assume that SRFI-64 catches the "Unbound variable" exception somehow and return #f which is the value the test is coincidently waiting for… Changing the test to (test-error "empty password is not valid" #t (password-valid? "")) Will pass : $ guile -L . char-sets-test.scm ;;; note: source file ./char-sets.scm ;;; newer than compiled /home/jeko/.cache/guile/ccache/3.0-LE-8- 4.4/tmp/char-sets.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling ./char-sets.scm ;;; compiled /home/jeko/.cache/guile/ccache/3.0-LE-8-4.4/tmp/char- sets.scm.go %%%% Starting test harness-char-sets (Writing full log to "harness- char-sets.log") # of expected passes 1 This indicates an error is raised : $ cat harness-char-sets.log %%%% Starting test harness-char-sets Group begin: harness-char-sets Test begin: test-name: "empty password is not valid" source-file: "char-sets-test.scm" source-line: 8 source-form: (test-error "empty password is not valid" #t (password- valid? "")) Test end: result-kind: pass actual-error: (unbound-variable #f "Unbound variable: ~S" (password- valid?) #f) expected-error: #t Group end: harness-char-sets # of expected passes 1 But I am a bad assumption-er so I should ask to the srfi-64 mailing list haha. I'm wondering if Guile can return #unspecified ? > If you want to see the extend to which you can play with macros, you > can > have a look at my natural-script-writing entry-point (from enter- > three-witches): > https://hg.sr.ht/~arnebab/dryads-wake/browse/enter.w?rev=tip#L349 I will have a look at it, thank you for sharing. I think I will have a look even to some of your repos. Haha ! > Thank you for your book! Thank you for reading :-) Cheers, Jérémy