On 04/02/2018 11:34 PM, Martin Sebor wrote: > On 04/02/2018 12:09 AM, Sandra Loosemore wrote: >> On 03/27/2018 03:21 PM, Pedro Alves wrote: >>> On 03/27/2018 09:19 PM, Martin Sebor wrote: >>>> On 03/27/2018 01:38 PM, Pedro Alves wrote: >>>>> On 03/27/2018 07:18 PM, Martin Sebor wrote: >>>>>> +Because a @code{pure} function can have no side-effects it does not >>>>> >>>>> FWIW, I'd suggest rephrasing as: >>>>> >>>>> Because a @code{pure} function cannot have side effects >>>>> >>>>> because "can have no side-effects" can be read as >>>>> "is allowed to have no side effects", which gave me pause >>>>> when I read it the first time, and is the opposite of >>>>> what you mean. >>>> >>>> That is what I meant: that const and pure functions are not allowed >>>> to have any side-effects. If they did, they could be unexpectedly >>>> eliminated (i.e., the behavior is undefined when such a function >>>> does have a side-effect). >>> >>> I know, but that's not what I read the first time (and found it >>> odd so I had to re-read). You can either assume that I'm the >>> only one that will misunderstand it on first read, or you can >>> swap a couple words and be sure no one will misunderstand it. >>> >>> Up to you. >> >> I'm chiming in a little late here, but I agree with Pedro that "can have >> no side-effects" is confusing. I'd say "cannot have side effects" or >> "must have no side effects" instead. > > There's nothing confusing about it. It's an established phrase > with millions of uses and only one meaning. According to Google > Books Ngram Viewer it's also more pervasive than either of > the two suggested alternatives: > > http://goo.gl/FgXgwi
Sorry, but no. The different phrases have slightly different meanings. The fact that one is used more often than than the other does not imply that they have the same meaning, any more than this: http://goo.gl/U64uDZ shows that people nowadays say "red" more often when then mean "blue". Compare: #1. The red pill can have no side effects. (If you're lucky. It's not guaranteed. Buyer beware.) #2. The blue pill cannot have side effects. (That's a guarantee.) Those are different statements. #1 implies possibility, while #2 leaves no margin for error. When you say that "a pure function can have no side effects", that can be reasonably read as a pure function may have no side effects if it chooses to, i.e., it's not required to have side effects. But, a pure function _must_ have no side effects. If a function has side effects, then it no longer is a pure function, by definition. That's what reads confusingly. Your url actually proves the point. Follow the url at the bottom of that page: https://www.google.pt/search?q=%22can+have+no+effect%22&tbm=bks&lr=lang_en&gws_rd=cr&dcr=0&ei=NUPDWqqoPInxUqP8jPgN And that leads to uses like: "In many cases, a treatment can have no effect or can have the effect" "the new grant can have no effect whatever, unless it have the effect" etc., etc. > >> Also note that non-hyphenated "side effects" seems to be preferred usage >> as a noun phrase (at least it's the only form listed by m-w.com). > > I'm all for using the preferred form. I've made the change here > and submitted a separate patch to remove the hyphen from the rest > of the occurrences. > > Attached is a changed patch that uses "cannot have side effects" > instead of "can have no side effects." Thank you. LGTM, FWIW. Pedro Alves