unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jeremy Bryant <jb@jeremybryant.net>
Cc: 66863@debbugs.gnu.org
Subject: bug#66863: [PATCH] Add two docstrings in cl-macs.el
Date: Tue, 31 Oct 2023 18:58:26 -0400	[thread overview]
Message-ID: <jwvttq6fm2y.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87bkcexvoy.fsf@jeremybryant.net> (Jeremy Bryant's message of "Tue, 31 Oct 2023 22:36:57 +0000")

> * lisp/emacs-lisp/cl-macs.el (cl--simple-exprs-p)
> (cl--const-expr-p): Add docstrings.

Hmm... tackling some tricky ones, eh?

>  (defun cl--simple-exprs-p (xs)
> +  "Check if no side effects, and executes quickly, for each element of list XS."
>    (while (and xs (cl--simple-expr-p (car xs)))
>      (setq xs (cdr xs)))
>    (not xs))

I think I'd use a ref to `cl--simple-expr-p`, so we don't duplicate the
poorly defined "no side effects, and executes quickly".

Wait... `grep` says this function is not used any more, so maybe the
better option is to delete it.

> @@ -118,6 +119,7 @@ cl--safe-expr-p
>  
>  ;;; Check if constant (i.e., no side effects or dependencies).
>  (defun cl--const-expr-p (x)
> +  "Check if X is constant (i.e., no side effects or dependencies)."
>    (cond ((consp x)
>  	 (or (eq (car x) 'quote)
>  	     (and (memq (car x) '(function cl-function))

Yeah..hmm.. by order of increasing preference:
- Move the comment to the docstring rather that just copying it.
- Clarify the difference with `macroexp-const-p`.
- Declare the function obsoleted by `macroexp-const-p`.
- Delete the function altogether.


        Stefan






  reply	other threads:[~2023-10-31 22:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 22:36 bug#66863: [PATCH] Add two docstrings in cl-macs.el Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-31 22:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-10-31 23:40   ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-01 12:17     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04  9:23       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-04 10:41         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvttq6fm2y.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66863@debbugs.gnu.org \
    --cc=jb@jeremybryant.net \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).