GNU bug report logs - #76055
29.4; Doc of string-empty-p

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Tue, 4 Feb 2025 20:29:01 UTC

Severity: minor

Tags: wontfix

Found in version 29.4

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "76055 <at> debbugs.gnu.org" <76055 <at> debbugs.gnu.org>
Subject: bug#76055: 29.4; Doc of string-empty-p
Date: Wed, 5 Feb 2025 21:13:05 +0000
> > To be more precise: Please do it for each
> > such function where you can guess that this
> > behavior isn't just a side effect or that's
> > likely to be changed without notice.
> 
> How can anyone know that?

By looking at the name of the function and the
function definition, and thinking about how
the function is used and expected to be used?

A function such as `string-empty-p' is a prime
candidate for checking and adding such mention.

Its name (and its current doc string) provides
no clue that it handles a symbol argument as
if you were passing (symbol-name <the symbol>).

If a function name shouts that the function's
only about a string, its doc should mention it if
that's not the case.

> > My guess is that 90% or more of the cases
> > where we do this are intentional - we
> > explicitly _want_ to let users use a symbol
> > in place of a string.  That means it's in
> > the _design_, not just an implementation
> > side effect.
> 
> That a function calls string= doesn't yet mean its author meant to
> allow symbols.

Of course not.  It requires thinking about the
function's definition and how it's expected to
be used.

At least for _new_ functions that use primarily
strings as args, the _author_ should know why it
was decided to allow symbols instead of just
strings.




This bug report was last modified 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.