From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Saving match data Date: Sun, 08 Oct 2017 15:56:52 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c13f0a0f563ff055b0b1f05" X-Trace: blaine.gmane.org 1507478229 20253 195.159.176.226 (8 Oct 2017 15:57:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 8 Oct 2017 15:57:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 08 17:57:05 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1Dwt-0004Zv-JR for ged-emacs-devel@m.gmane.org; Sun, 08 Oct 2017 17:57:03 +0200 Original-Received: from localhost ([::1]:54152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Dx1-0005Ul-5H for ged-emacs-devel@m.gmane.org; Sun, 08 Oct 2017 11:57:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Dwu-0005Ud-AQ for emacs-devel@gnu.org; Sun, 08 Oct 2017 11:57:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1Dwt-0002tl-JU for emacs-devel@gnu.org; Sun, 08 Oct 2017 11:57:04 -0400 Original-Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:43556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1Dwt-0002tG-EJ for emacs-devel@gnu.org; Sun, 08 Oct 2017 11:57:03 -0400 Original-Received: by mail-oi0-x234.google.com with SMTP id c77so34150051oig.0 for ; Sun, 08 Oct 2017 08:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=agOOr1Xr1Bt3hmRKtd7wrfSKBKlTou6cnXTrB1yJmc4=; b=ONl8SMtpsGvh9heAiDYQLoPQnE2wP4eo5WfAzfGndB/CFS5TZdWEIV5HH2bPvttJG5 X1WLd3GZlwa0OvctG1TyD6qL2hCbCvN0kF1xLflfUqvKHtCOWl7AeEFkz7AAGdim5n0S lPmZJHyya7dKOt0owELYUsNt4+IWfPmpktFPEhk4zFRKRrLoWiOELDFdrXCvLQCKGFe5 DLRISZY7o1No1ewwCo/VFS9RLHHeTJ1+5S8BJGcDmID8zMvrlNDd8Z4oZjE7iRa4m641 +f5FZbDamRR1BBhZvzV6JE3UvoxCMnTgDFMvo7Z2gmPlEzP2rAC8ssGFPRuzcg8IbCZB yXEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=agOOr1Xr1Bt3hmRKtd7wrfSKBKlTou6cnXTrB1yJmc4=; b=AAb9cFEw+j9X9kay0YAwpMmKy6ZC6DeT8y0jqxnTtjJvLYAoCRHWIlgnq7kfdy/VKp XsfwT+167qF0+CmrcDe51cpqHlH+E5aMyzKVRWKsQeF3tLyaYi2G2/mBOQIRK7mBQQ3J GijXVYILms4mluOssu8PpVKZwN7CsZabEy5fEoK6ijJDExW6pe1Rh5t6Q0howVb1KdMB KXQKPPkfv2/plWNSNmxG7+7PYyH8aa2SsoluuJl8M7+WtOBhhAmuFFSjqEmnfYA+fd3q 0I1X1I4pXyJ4Cwn07hfva/8KjB6CQMIxgS8DfVm7hNr5/i42VnjiZUeQo/W0fjRTQiV7 PpGg== X-Gm-Message-State: AMCzsaUiqadLgn1cxj+VHhy3Dw8Ep5lGuPH+7lqtdEmysH4k3GmQQXvF Seqotan8RmZzSkyMthEozz2hOehnV3axn5ZgW3M= X-Google-Smtp-Source: AOwi7QAqiFByjS2DOGG6rPJ669lMw14ieAOPEG6WngfJZQCMfQqSnrwTlf9OTUnTLV+OdXaFnrWbgBvSiigYAwcJ9pQ= X-Received: by 10.202.7.198 with SMTP id 189mr4101107oih.18.1507478222495; Sun, 08 Oct 2017 08:57:02 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219253 Archived-At: --94eb2c13f0a0f563ff055b0b1f05 Content-Type: text/plain; charset="UTF-8" Philipp Stephani schrieb am Sa., 17. Juni 2017 um 16:02 Uhr: > Stefan Monnier schrieb am Sa., 17. Juni 2017 > um 15:53 Uhr: > >> > + (when (or (function-get function 'pure) >> > + (function-get function 'side-effect-free)) >> > + (insert "\nThis function does not change the match >> data.")) >> >> Wouldn't it be more useful to say it doesn't have side-effects (which >> would obviously imply it doesn't change the match-data, along with all >> other global state)? >> >> > I'd prefer to mention the match data explicitly, because users might not > be aware that they are part of the global state. Maybe something like "This > function does not (access|change) global state, including the match data" > (where "access" can be used for the pure ones). > Given there were no more comments, I've pushed the patch (with the changed wording) to master as f4995e7d36. --94eb2c13f0a0f563ff055b0b1f05 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Sa., 17. Juni 2017 um 16:02=C2=A0Uhr:
Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Sa., 17. Juni = 2017 um 15:53=C2=A0Uhr:
> +=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (or (function-get function = 9;pure)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (function-get function 'side-effect-free))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert "\nThis= function does not change the match data."))

Wouldn't it be more useful to say it doesn't have side-effects (whi= ch
would obviously imply it doesn't change the match-data, along with all<= br> other global state)?


I'd prefer to mention the match data explicitly, beca= use users might not be aware that they are part of the global state. Maybe = something like "This function does not (access|change) global state, i= ncluding the match data" (where "access" can be used for the= pure ones).=C2=A0

Given = there were no more comments, I've pushed the patch (with the changed wo= rding) to master as f4995e7d36.=C2=A0
--94eb2c13f0a0f563ff055b0b1f05--