From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#72313: 31.0.50; Warning about cl-member possibly being undefined when using cl-pushnew Date: Sat, 27 Jul 2024 09:13:50 +0200 Message-ID: <875xsrjoi9.fsf@gnu.org> References: <874j8bx5gr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29367"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72313@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 09:15:11 2024 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 1sXbe2-0007Ug-QA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 09:15:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXbdn-0003xl-7H; Sat, 27 Jul 2024 03:14:55 -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 1sXbdl-0003qh-FJ for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 03:14:53 -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 1sXbdl-0000Ot-6r for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 03:14:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXbdu-0002fJ-R3 for bug-gnu-emacs@gnu.org; Sat, 27 Jul 2024 03:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jul 2024 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72313 X-GNU-PR-Package: emacs Original-Received: via spool by 72313-submit@debbugs.gnu.org id=B72313.172206445810096 (code B ref 72313); Sat, 27 Jul 2024 07:15:02 +0000 Original-Received: (at 72313) by debbugs.gnu.org; 27 Jul 2024 07:14:18 +0000 Original-Received: from localhost ([127.0.0.1]:40431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbdC-0002cV-Cw for submit@debbugs.gnu.org; Sat, 27 Jul 2024 03:14:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXbd5-0002a6-UU for 72313@debbugs.gnu.org; Sat, 27 Jul 2024 03:14:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXbcq-0000G5-Ug; Sat, 27 Jul 2024 03:13:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Srgifa/YkgNmcmuRea4g7tDvaZk2iBLP5Fgd2f+sYIs=; b=ETzCXIg+2RQdeR2V3NoQ wLbm51ajdu7v6hmZZyEwS5J+Fw8O832jC1vz2mO+5zSLrhbtuneUsHlmAVZq7Qd6LaNE28qhbxhhK +ZVPLctvvcO/4Th4QphhyHjtet0/5uG58rsMaSiir70098/qY4N0N6KFMAHlxudk1aLyIifAGD5j/ 1neUw2zc6Kis8QJpPyMH+gnp6FzwdbAEJ5MYz0MslKlAogwHy3KC4a1wSbi2bF/VA+knuRWr0/cty R3AmGKMZ9Z5YuirxT5vMYkKSlc1zGQ77/8SONG3v/ys4HdXarP+GgwkeQDhZ0F1NIRX6GdzVZns3h gZAPfQbF4QfksA==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieeigdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepte eltdegheffhfetkeekveekkeevgfegkeetueffleeiheekhffgffeuueegieffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhdpnhgspghrtghpth htoheptd X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: (Stefan Monnier's message of "Sat, 27 Jul 2024 03:01:32 -0400") 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:289408 Archived-At: Stefan Monnier writes: Hi Stefan, > (macroexpand-all '(cl-pushnew (list 1 2 3) s :test (lambda (_a _b) nil))) > => > (setq s > (let* ((va (list 1 2 3))) > (if (cl-member va s :test #'(lambda (_a _b) nil)) s (cons va s)))) > >> My assumption is that (eval-when-compile (require 'cl-lib)) should be >> fine when using only macros from cl-lib which in turn should expand >> to cl-free code, > > That's not the case here (and a few other places). In the past, I've > moved some of this kind of code to `cl-preloaded`, so as to make > things easier for programmers (to avoid them having to know which CL > macros emit code which calls CL functions (and when)), but there are > still cases like above, yes. So the conclusion is to simply (require 'cl-lib) instead of (eval-when-compile (require 'cl-lib))? But how can the byte-compiler conclude that cl-member might not be defined at runtime given that it's an autoloaded function? Addon question: should a package list cl-lib in Package-Requires if it already requires an Emacs version where a good-enough cl-lib is included anyway? Thanks, Tassilo