From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66863: [PATCH] Add two docstrings in cl-macs.el Date: Tue, 31 Oct 2023 18:58:26 -0400 Message-ID: References: <87bkcexvoy.fsf@jeremybryant.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40743"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66863@debbugs.gnu.org To: Jeremy Bryant Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 01 00:01:54 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qxxk9-000ARP-9X for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Nov 2023 00:01:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qxxjr-0002Ml-G2; Tue, 31 Oct 2023 19:01:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxxjm-0002MU-HT for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 19:01:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxxjk-0005q2-JN for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 19:01:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qxxkI-0001oP-9S for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 19:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Oct 2023 23:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66863 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16987933006930 (code B ref -1); Tue, 31 Oct 2023 23:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Oct 2023 23:01:40 +0000 Original-Received: from localhost ([127.0.0.1]:49472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxxjv-0001nh-SX for submit@debbugs.gnu.org; Tue, 31 Oct 2023 19:01:40 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:45526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qxxjq-0001nJ-IR for submit@debbugs.gnu.org; Tue, 31 Oct 2023 19:01:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxxj6-0002E2-Tw for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 19:00:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qxxj1-0005mv-HN for bug-gnu-emacs@gnu.org; Tue, 31 Oct 2023 19:00:48 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EDEAC1000BC; Tue, 31 Oct 2023 19:00:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1698793241; bh=l5YANpX8CS1yWSb0p6btPuyRwVF4m/WH59w4tqI+Fic=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=NxYpF96iICgP1dvh1PU5Leq/I/DkuCadUB0AFClVddt0CPdz0h6TlVXI7KaQYdPqf ykcPlc96O/uDTTG/2qrPcl5pN10g+NI9EwQCuDbc/psxtVzTu3wQHLhWkxyyhckyZ7 uLAPPWtUwC73PKe4pZtm7Y1srxi6tJpaXBNnf8OIoI6GuXRzA0jAKCTrwjWGQsbRTE 2cFrZiFsJ/wHgj9/SOyHCrZubpEWEVzf6328ql13k6fGS3O6GLt0M1zZ9+XT8P9qkG n4XaPy4wjS/9dSyaYi7FDZDfgpvdGnI2Q4SQojrI8B4lOH5evlRd2RDxSrdukeCltm wnVbQDZho8lKg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 54FC1100033; Tue, 31 Oct 2023 19:00:41 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 469E61203DA; Tue, 31 Oct 2023 19:00:41 -0400 (EDT) In-Reply-To: <87bkcexvoy.fsf@jeremybryant.net> (Jeremy Bryant's message of "Tue, 31 Oct 2023 22:36:57 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273577 Archived-At: > * 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