bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#69387: 30.0.50; A string shouldn't be both a docstring and a return


From: Stefan Monnier
Subject: bug#69387: 30.0.50; A string shouldn't be both a docstring and a return value
Date: Mon, 26 Feb 2024 12:44:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> (defun semantic-mrub-read-history nil
>>   "History of `semantic-mrub-completing-read'.")
>
> ... which is then not called but used as a variable by the code.

Looks like a defvar-vs-defun typo.

> Or this one:
>
>> ;; Don't alias this to `ignore', as that will cause the resulting
>> ;; function to be interactive.
>> (defun use-package-normalize/:disabled (_name _keyword _arg)
>>   "Do nothing, return nil.")
> Return nil my foot.

:-)

> The docstring-result syndrome is particularly common in
> `cl-defgeneric` because it's not seen as code that will ever be used,
> so we should probably not warn in that case.

I don't understand: (cl-defgeneric FUN (ARGS) "DOCSTRING") should not
generate a function that returns "DOCSTRING" (it should just declare
FOO to be a generic function with no methods).

> We could expand
>
>  (defun (ARGS) "string") -> (defun (ARGS) "string" "string")
>
> to preserve semantics (and the same for defmacro, cl-defun, etc).

I still haven't seen any code that wants this behavior, so that's
a definite no for me.


        Stefan






reply via email to

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