bug#59221: (file-exists? #f) raises an exception

<[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <[email protected]>
On Sun, Nov 13, 2022 at 02:15:43AM +0000, jbranso--- via Bug reports for GUILE, GNU's Ubiquitous Extension Language wrote:
> November 12, 2022 12:58 PM, "Jean Abou Samra" <[email protected]> wrote:
> 
> >> Le 12 nov. 2022 à 18:50, Joshua Branson via Bug reports for GUILE, GNU's Ubiquitous Extension
> >> Language <[email protected]> a écrit :
> >> 
> >> Hello you lovely guile people!
> >> 
> >> This bug is so simple the subject line says it all!

[file-exists? raises exception on #f]

[...]

> > It is normal for predicates to be defined only on certain types. You will find the same with
> > positive?, string-null? and the like.
> 
> Perhaps I am just being really pedantic.  I asked in the #guile irc chat if a predicate should 
> be able to raise an exception.  The answer I was given was no.

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<?', etc.
do this. That seems to be the consensus.

Cheers
-- 
t
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY3CSPQAKCRAFyCz1etHa
Rl2rAJ9rUYtWx1MWhRey5NUhWSIGe9q8UwCfVKWXhvJqo3psOKsenfBdK9imsEk=
=pC73
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.