From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joshua Branson via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" Newsgroups: gmane.lisp.guile.bugs Subject: bug#59221: (file-exists? #f) raises an exception Date: Wed, 16 Nov 2022 10:27:34 -0500 Message-ID: <87bkp62a3d.fsf@dismail.de> References: <1D1C3D58-0BC7-40C2-AC1A-38E59C53FE00@abou-samra.fr> <87y1sghxm2.fsf@dismail.de> <8627ff0decc84502a4325fd64a425feb@dismail.de> <1b3d4aa0-139c-1491-cd08-57055b9bec7a@abou-samra.fr> Reply-To: Joshua Branson Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59221@debbugs.gnu.org, tomas@tuxteam.de To: Jean Abou Samra Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Nov 16 16:29:31 2022 Return-path: Envelope-to: guile-bugs@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 1ovKLy-0007SH-IV for guile-bugs@m.gmane-mx.org; Wed, 16 Nov 2022 16:29:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovKKa-0004EK-8D; Wed, 16 Nov 2022 10:28:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovKKY-0004AQ-ME for bug-guile@gnu.org; Wed, 16 Nov 2022 10:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovKKY-0004Iz-DB for bug-guile@gnu.org; Wed, 16 Nov 2022 10:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ovKKX-0003Yo-W8 for bug-guile@gnu.org; Wed, 16 Nov 2022 10:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Joshua Branson Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 16 Nov 2022 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59221 X-GNU-PR-Package: guile Original-Received: via spool by 59221-submit@debbugs.gnu.org id=B59221.166861246713665 (code B ref 59221); Wed, 16 Nov 2022 15:28:01 +0000 Original-Received: (at 59221) by debbugs.gnu.org; 16 Nov 2022 15:27:47 +0000 Original-Received: from localhost ([127.0.0.1]:57886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovKKJ-0003YL-CZ for submit@debbugs.gnu.org; Wed, 16 Nov 2022 10:27:47 -0500 Original-Received: from mx2.dismail.de ([159.69.191.136]:45383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ovKKG-0003Y1-Vf for 59221@debbugs.gnu.org; Wed, 16 Nov 2022 10:27:45 -0500 Original-Received: from mx2.dismail.de (localhost [127.0.0.1]) by mx2.dismail.de (OpenSMTPD) with ESMTP id edb7b6db; Wed, 16 Nov 2022 16:27:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type:content-transfer-encoding; s=20190914; bh=5erTYL1y unOlKVJ6/F2H8Os+1IV+u4qfHAw/8mzPQLU=; b=Kor3+pKyXIlP2AgIyBwHZ5D2 0gyWjS07gxBYOnn+ASY8b0CjGVXblAgwQNM/A0FT78kkZZI+a1V3Vf496VyIX2P1 i+8qhocYLx7EviMxAddRBlR5PNIAjffW9fxL1Yn1UEVbI82KII+Unp5t1vMhSqKk 75JiRLOG0ZDztqa4cdC2L60+Ye936bxihDTiR8YnVqKub61JZMNprkombASM0OBD MOeK49DDc/O6JWzhSWhw0xIon1oot7K8jP8rbtgFTdZnZzmeOCxJ4Wq6n6Kt9Xzb ZQiqY+l/sVs1H41Z50FyX9rkZ41QNqWSIaI9CnG7i1xvO04WmeA9MsG8ItS7TQ== Original-Received: from smtp1.dismail.de ( [10.240.26.11]) by mx2.dismail.de (OpenSMTPD) with ESMTP id 67c0dd97; Wed, 16 Nov 2022 16:27:37 +0100 (CET) Original-Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id b1e117a1; Wed, 16 Nov 2022 16:27:36 +0100 (CET) Original-Received: by dismail.de (OpenSMTPD) with ESMTPSA id 90b884ec (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Nov 2022 16:27:36 +0100 (CET) In-Reply-To: <1b3d4aa0-139c-1491-cd08-57055b9bec7a@abou-samra.fr> (Jean Abou Samra's message of "Sun, 13 Nov 2022 11:34:08 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10432 Archived-At: Jean Abou Samra writes: > Le 13/11/2022 =C3=A0 07:44, tomas@tuxteam.de a =C3=A9crit=C2=A0: >> You both have a point. Checking for existing predicates with a >> longer tradition, though: >> >> scheme@(guile-user)> (exact? "mumble") >> ice-9/boot-9.scm:1685:16: In procedure raise-exception: >> In procedure exact?: Wrong type argument in position 1: "mumble" >> >> seems to support Jean Abu's position that it is more customary to >> raise for an argument of the wrong type. Also `string> do this. That seems to be the consensus. > > > Yes. I am not sure where the people in the Guile IRC got the idea > that a predicate shouldn't raise an exception. Lots of predicates in > Guile do, and that is very helpful because it catches mistakes. > > >> Naively, it just feel like it (file-exists? #f) should return #f. > > > Why? > hmmm, somehow I missed your response. I guess for my simple use case, it just made more sense. I am defining a service for guix that asks for user input. If the user doesn't type in input, the default value was #f. That's fine. Thanks for all's replies. I'll go ahead and close this bug! Thanks! > > >> Would there be an objection to changing the definition of file-exists to >> >> (define (file-exists file) >> (and (string? file) >> (old-file-exists-code file))) > > > > It would be inconsistent with the rest of Guile and I don't > see what it would help with. > > Best, > Jean