emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: file-exists-p on empty string


From: Drew Adams
Subject: RE: file-exists-p on empty string
Date: Wed, 27 Feb 2019 14:01:10 -0800 (PST)

> > I gree, but there is not a line about empty strings in doc-string.
> > It is great that this is mentioned in documentation, but anyway
> > behaviour was quite unexpected
> 
> The problem is that docstrings describe the behavior of a specific
> function, so they usually don't mention the more general aspects that
> affect all functions of a given subsystem, such as here the general
> treatment of the empty string when used as a file name.
> 
> Otherwise, every file-name-manipulating function would have to repeat
> this information in its docstring.

Every such function _should_ have this info in
its doc string.  There's no reason not to.

In terms of the _implementation_ this might be
a "general aspect that affects all functions of
a given subsystem".  But in terms of the doc for
a given such function this is not (only) a
general subsystem aspect - it is part of the
individual function's definition & description.

Even if this weren't such a gotcha, the doc for
the function should describe the return value,
including for any particular input cases.

A user might well start with `C-h f', and not
with some reading of the general-subsystem doc
(assuming there is such doc).  Such info is
pretty important to understanding the particular
function.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]