From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: Emacs 30.0 warning from `cl-pushnew' and `memql' Date: Thu, 29 Dec 2022 07:03:40 +0100 Message-ID: References: <878ritgaty.fsf@dataswamp.org> <87o7rprvia.fsf@web.de> <87zgb913fg.fsf@dataswamp.org> <87ilhveo2s.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j7fJOJgXgLpKXbZ9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27657"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Drew Adams , Michael Heerdegen To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 29 07:04:33 2022 Return-path: Envelope-to: geh-help-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 1pAm1p-00070H-0Q for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 29 Dec 2022 07:04:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAm17-0004je-4u; Thu, 29 Dec 2022 01:03:49 -0500 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 1pAm15-0004et-Kv for help-gnu-emacs@gnu.org; Thu, 29 Dec 2022 01:03:47 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAm13-0004zs-7A for help-gnu-emacs@gnu.org; Thu, 29 Dec 2022 01:03:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vLhHfelxJIOKUix5u8ciyTaq1Mlc6SyPAaLekZEOItI=; b=BDfP+8O36UwAhushwlYpfoKuqe cX0T0/tVfmEAYGytSBOaZbZ+u6INNcY7IBVtXMVUCWA4dM4OA/RQO4Qm90s92uBpp+LcfzbxpdwEJ ST/u4lpz/7+mRnQr7mufs8EjlqliRvMtrq9/6QiXjlRoV0wa83cOpLejm7A8WlNz2UBgHdnCV8ZqD njLwzx6KWuHkobEFF7I8+vsxbiuHFSD1Viw8CVPjHSIxA2pZk7tMFS9cO+zUA5mZMWVQ5i4iKlikn y/tyr7/DtEht11vhjv/GRRInEtt4gIZDsZU6zynLmO0Jt86+j/aL0bh5v3ZK9d6QPp/LSB/j3Jcx4 YL0vBybA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1pAm0y-0008P0-5J; Thu, 29 Dec 2022 07:03:40 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142014 Archived-At: --j7fJOJgXgLpKXbZ9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 29, 2022 at 01:47:57AM +0300, Jean Louis wrote: [...] > > (And no reason to quote either () or a literal string.) >=20 > There was reason. See here: >=20 > (setq my-list '()) > (benchmark 1000 (setq my-list (cons "Word" my-list))) >=20 > Debugger entered--Lisp error: (invalid-function "Word") > ("Word") > (closure (t) nil ("Word"))() [...] > but then `benchmark` worked only first time, second time it gave > error. Read benchmark's doc string carefully :-) Benchmark is a /function/, so its argument is evaluated first. By the Rule of Lisp [1], args are evaluated first... (benchmark (cons "Word" my-list)) =3D> (benchmark ("Word")) =3D> ; since list is empty =2E.. and then it tries to evaluate the function application ("Word"), which explains your error message. If now you look again at the benchmark's docstring it says to provide a form. This means you have to quote the whole thing like so: (benchmark 1000 '(setq my-list (cons "word" my-list))) If you just quote "Word", you are benchmarking the wrong thing, anyway :) Cheers [1] aka "strict order evaluation" https://en.wikipedia.org/wiki/Evaluation_strategy#Strict_evaluation --=20 t --j7fJOJgXgLpKXbZ9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY60tsQAKCRAFyCz1etHa RtmyAJ9H+4FK4vqxS2HEb7fcmIPYZWebKACbBi6lMGc5ek2VWIGUghxKokT0YmU= =Gt7S -----END PGP SIGNATURE----- --j7fJOJgXgLpKXbZ9--