From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Predicate for true lists Date: Thu, 18 Apr 2019 17:37:27 +0300 Message-ID: <83a7gne5w8.fsf@gnu.org> References: <87fu3vdjjk.fsf@tcd.ie> <87bmcqhhsf.fsf@tcd.ie> <87in6xgtpb.fsf@tcd.ie> <2af892df-26cb-60b2-4fd8-067fcb3d32e9@cs.ucla.edu> <87r2kh9uwx.fsf@tcd.ie> <83h8lcnbxb.fsf@gnu.org> <87sh4s9poo.fsf@tcd.ie> <87k1q49p0i.fsf@tcd.ie> <87efgbbq2p.fsf@tcd.ie> <87a7gz8hp2.fsf@tcd.ie> <875zrn9bum.fsf@tcd.ie> <835zrm7fow.fsf@gnu.org> <878swivtcr.fsf@gmail.com> <87r2aayln2.fsf@tcd.ie> <87lg0hyidf.fsf@tcd.ie> <87tvew7bxj.fsf@tcd.ie> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="269671"; mail-complaints-to="usenet@blaine.gmane.org" Cc: branham@utexas.edu, monnier@iro.umontreal.ca, drew.adams@oracle.com, emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 18 16:37:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hH8Am-001836-5m for ged-emacs-devel@m.gmane.org; Thu, 18 Apr 2019 16:37:56 +0200 Original-Received: from localhost ([127.0.0.1]:42386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH8Al-0007un-6O for ged-emacs-devel@m.gmane.org; Thu, 18 Apr 2019 10:37:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH8Af-0007u6-Bb for emacs-devel@gnu.org; Thu, 18 Apr 2019 10:37:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:32849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH8Ae-00048V-7S; Thu, 18 Apr 2019 10:37:48 -0400 Original-Received: from [176.228.60.248] (port=3397 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hH8Ad-0004Ip-K4; Thu, 18 Apr 2019 10:37:48 -0400 In-reply-to: <87tvew7bxj.fsf@tcd.ie> (contovob@tcd.ie) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:235619 Archived-At: > From: "Basil L. Contovounesios" > Cc: Alex Branham , Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org > Date: Wed, 17 Apr 2019 18:56:40 +0100 > > --- a/doc/lispref/functions.texi > +++ b/doc/lispref/functions.texi > @@ -38,11 +38,16 @@ What Is a Function > @cindex return value > @cindex value of function > @cindex argument > +@cindex side effect > +@cindex pure function > In a general sense, a function is a rule for carrying out a > computation given input values called @dfn{arguments}. The result of > the computation is called the @dfn{value} or @dfn{return value} of the > function. The computation can also have side effects, such as lasting > changes in the values of variables or the contents of data structures. > +A @dfn{pure function} is a function which, in addition to having no > +side effects, always returns the same value for the same combination > +of arguments, regardless of external factors such as machine type. The index entry "side effect" here means that this term is explained. But the text doesn't live up to that promise, it just gives an example. Can we add a more general explanation? > +@cindex @code{side-effect-free} > +@cindex @code{pure} > +@vindex side-effect-free-fns > +@vindex side-effect-and-error-free-fns Some of these index entries are redundant, because they start with the same string and point to the same place in the manual. Also, you already have an index entry "pure" elsewhere. If you think there should be another one that points here, please qualify one or both, so that the entries will be different. having identical index entries gets in the way when you type "i foo TAB" and are presented with completion candidates "foo" and "foo<1>", with no way of telling which one do you want. > + If you define a function which is side-effect free and/or pure, give > +it a non-@code{nil} @code{side-effect-free} and/or @code{pure} > +property, respectively (@pxref{Standard Properties}). Alternatively, > +you can update the code in @file{byte-opt.el} that binds > +@code{side-effect-free-fns} and @code{side-effect-and-error-free-fns}, > +but this approach is less modular and no longer encouraged. I don't think we need to tell in the manual when to modify the sources, so I think the last sentence should be removed. > --- a/doc/lispref/macros.texi > +++ b/doc/lispref/macros.texi > @@ -523,6 +523,7 @@ Eval During Expansion > > @node Repeated Expansion > @subsection How Many Times is the Macro Expanded? > +@cindex side effect Once again, a duplicate index entry without qualifications. > --- a/doc/lispref/symbols.texi > +++ b/doc/lispref/symbols.texi > @@ -558,9 +558,12 @@ Standard Properties > modes. @xref{Setting Hooks}. > > @item pure > +@cindex @code{pure} Likewise. > @@ -579,9 +582,13 @@ Standard Properties > for the named variable. @xref{File Local Variables}. > > @item side-effect-free > +@cindex @code{side-effect-free} And again. Thanks.