From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Newsgroups: gmane.lisp.guile.bugs Subject: bug#14922: guard expression doesn't catch everything Date: Sun, 21 Jul 2013 11:29:03 +0200 Message-ID: <87d2qcqn1c.fsf@industria.weinholt.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1374399015 19873 80.91.229.3 (21 Jul 2013 09:30:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Jul 2013 09:30:15 +0000 (UTC) To: 14922@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Jul 21 11:30:13 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V0pxz-0006Li-TK for guile-bugs@m.gmane.org; Sun, 21 Jul 2013 11:30:12 +0200 Original-Received: from localhost ([::1]:33109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxz-0000r4-FO for guile-bugs@m.gmane.org; Sun, 21 Jul 2013 05:30:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxv-0000qS-JA for bug-guile@gnu.org; Sun, 21 Jul 2013 05:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0pxu-0001y3-3R for bug-guile@gnu.org; Sun, 21 Jul 2013 05:30:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxt-0001xQ-VK for bug-guile@gnu.org; Sun, 21 Jul 2013 05:30:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V0pxs-00072x-Jn for bug-guile@gnu.org; Sun, 21 Jul 2013 05:30:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 21 Jul 2013 09:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14922 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137439898726954 (code B ref -1); Sun, 21 Jul 2013 09:30:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Jul 2013 09:29:47 +0000 Original-Received: from localhost ([127.0.0.1]:40632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0pxa-00070d-RN for submit@debbugs.gnu.org; Sun, 21 Jul 2013 05:29:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56308) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0pxX-000707-Iy for submit@debbugs.gnu.org; Sun, 21 Jul 2013 05:29:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0pxR-0001Qg-Ag for submit@debbugs.gnu.org; Sun, 21 Jul 2013 05:29:38 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxR-0001Qc-72 for submit@debbugs.gnu.org; Sun, 21 Jul 2013 05:29:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxQ-0000V1-4G for bug-guile@gnu.org; Sun, 21 Jul 2013 05:29:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0pxO-0001Q2-OL for bug-guile@gnu.org; Sun, 21 Jul 2013 05:29:36 -0400 Original-Received: from iustitia.weinholt.se ([2a02:28f0:0:a::7dce:e5a8]:52913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0pxO-0001P1-DK for bug-guile@gnu.org; Sun, 21 Jul 2013 05:29:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=weinholt.se; s=iustitia2012; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=uaQbBABNOUIFhpCNDYCxaGl3AjyZJhq5n+hkm55Jl4I=; b=jnDTGSlUTALiKbluC52njNOz2H+CM2hCj7c/fZE9DWQSqaLZWmfJVAmPswp4bBhNRE+PXV63KFta+wpVOMy8p3K37EMhGoEzTdOR4NC6Nm5yCHClh6yKdmraYXhXWDDLd+r4xGYxRGvoCHx0cb11lhe4fR+zuEz18wtYAxWx48qi3JC47VNpjaz5cFM4V2aEiXl5yPa+JDol2Wxi42Y3dfVO8OdTJSk8ok0Fhrr193gdNq2JbSmgT3JckNauLSeDlMrb2VgL6VcQipBc7h8Rpsz7HAo5/K19+N6SMn5eoCVZmaw4XVpzQwE4zYd3kBFvANu0MjQqJuqkKf/FCOFJow==; Original-Received: from uucp by iustitia.weinholt.se with local-bsmtp (Exim 4.72) (envelope-from ) id 1V0pxG-0004ey-R1; Sun, 21 Jul 2013 11:29:26 +0200 Original-Received: from weinholt by industria with local (Exim 4.80) (envelope-from ) id 1V0pwz-0001gv-E4; Sun, 21 Jul 2013 11:29:09 +0200 X-Hashcash: 1:20:130721:bug-guile@gnu.org::wwz3cVu0cY8t/3qs:000000000000000000000000000000000000000000001jQr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7243 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello schemers, the guard expression from (rnrs) would be a lot more useful if it managed to catch all exceptions. As it is now, some errors will bypass the guard: scheme@(guile-user)> (import (rnrs)) scheme@(guile-user)> (guard (exn (else #f)) (fx+ #f #f)) $1 =3D #f scheme@(guile-user)> (guard (exn (else #f)) (fx+)) ;;; :3:0: warning: possibly wrong number of arguments to `fx+' rnrs/arithmetic/fixnums.scm:153:2: In procedure fx+: rnrs/arithmetic/fixnums.scm:153:2: Wrong number of arguments to # The background is that I'm working on a program that intentionally calls procedures with bad arguments, and it needs to determine if the procedure accepted the arguments or not. Ideally the object raised would be a proper and correct R6RS condition object, but I suspect that most of the existing Guile code doesn't raise conditions like that. I think it would be a step forward if guard at least caught the exception, even if the condition object might not be very useful. Tested with Guile 2.0.9.40-824b-dirty. Regards, =2D-=20 G=C3=B6ran Weinholt "Bring me back // to a story left untold // so we can write the ending." -- Aly & Fila feat. Jwaydan - We Control The Sunlight --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCgAGBQJR66nfAAoJEOM+YaLpuMOiVJUP/imwUxAO3TP5hxhjWgB2+Ge0 OpxRVBkh9ipLuFwzWZ006rROSg9eqNtGlVGuLf+s75p8ynQYY319ON04eTb8p4Fy ofODi9FHmQ7yOebjMvhBDedDEpzmGdbF7EcXRvTuqOvLa1i6kaWZpRmtNuzVBBA3 OZFp/MW//sKnUNlmsSHLBUIuJm6Kv3351aeYHNkDdi1A6q2Humj8HkvB82fmCDbO wdVziZdCXLzFo9/C9msuQPHTG/t3ukFYSbSmuNrr8BmN8G66owcRblHHzPgn5MLZ vph8UgBhQ6Y1ufZb8qQTE7Z0KoCHMTs+UwwJePWb9ySiidoDhPXJH4IduyJKM0Xv XmHfUInS8BKL9n44jIJMtI77dYHR3piZNez4N3sRkwWIQePTl+558XkCGkUYaMoj mBNx4xySIZ5FTn4H9aMZak6EjHAKBvEk1PiaEH0SR0CqxlCUGJitGjhmh5dMrL4H 9j61Aw9MAtEnJw5wAjOYRp/QuvS3TC28ziDjNDWO1ggTMmMo8Owst54kgQWc0tus L7m2dYnoaB/w/FlgCMYbYAx4agiWpO+4l/84d5MaXGnLaGEzRU0Uywp3kmD4YM3S f/BpNXLRboU534YxXNnNDd+I7RScsgcXFkcfl/ZaxpqFsKbG5vAmhRCb+us4ykPq Pg/9aIKApg9Y9ADfK7yS =vAKc -----END PGP SIGNATURE----- --=-=-=--