From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: A function to take the regexp-matched subsring directly Date: Mon, 31 Oct 2022 09:56:42 +0100 Message-ID: <826C0C38-3411-4D85-A202-18CA166BD3C2@acm.org> References: <87h6zl9q4u.fsf@posteo.net> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34960"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , daanturo , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 31 09:58:58 2022 Return-path: Envelope-to: ged-emacs-devel@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 1opQdF-0008pf-Rx for ged-emacs-devel@m.gmane-mx.org; Mon, 31 Oct 2022 09:58:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opQbw-0002xk-8n; Mon, 31 Oct 2022 04:57:36 -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 1opQbu-0002xB-M1 for emacs-devel@gnu.org; Mon, 31 Oct 2022 04:57:35 -0400 Original-Received: from mail1438c50.megamailservers.eu ([91.136.14.38] helo=mail263c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opQbs-0001j6-NL for emacs-devel@gnu.org; Mon, 31 Oct 2022 04:57:34 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1667206608; bh=RyEqZtWv/+wf/BBUavNlln81eAGHz7irk1CuqI3CU6w=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=OrfGe1zhTVEun3iaKfyZCkBR6Ky6cX4XK6VTMQKA+zAObYrlo8H1TW2MKTGUEW/0d 4H2yobOcbW9Rv4aACiChbmdWs3Pvk8f9HBko6ZxlxvE6wx1czg2vfifNzsS1P2/RZh /CKkUJ083fCbmLY64MSRL8SsFPbCRuqdh9xeZ85I= Feedback-ID: mattiase@acm.or Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se [188.150.171.209]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 29V8uh9F093223; Mon, 31 Oct 2022 08:56:46 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CTCH-RefID: str=0001.0A782F1A.635F8DD0.0001, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.38; envelope-from=mattiase@acm.org; helo=mail263c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298839 Archived-At: 30 okt. 2022 kl. 23.07 skrev Stefan Monnier : > The match-data is defined to be something very ephemeral, so it's OK for > pure functions to clobber it. > > Admittedly, here it doesn't just clobber it but sets it to a reliable > value, so there's a high risk that someone will rely on that match-data, > so better not mark it as pure, indeed, contrary to what I said earlier. Wouldn't be pure anyway since string-match depends on case-fold-search.